How to set single line text variable length?

vl92
Kilo Contributor

How to set single line text variable length?

I want to set variable length to 20 characters.

Any one please suggest me.

9 REPLIES 9

Vladimir6
Tera Expert

Hi,

Variable attributes: max_length=20 . Works on Portal too.

Right.  Yes it does.  And in case you can't find it, this is set on the "Default Value" tab of the Question, strangely, in the 2nd section there, underneath the default value.

find_real_file.png

Saurabh singh4
Kilo Guru

Hi

please try this on onLoad client script

select that particular variable name and set the max length value

g_form.getControl('var_name').setAttribute('maxlength', 20);
 

 

Please mark reply as Helpful/Correct, if applicable. Thanks in advance

saurabh

Vladimir6
Tera Expert

vl92, if you have got help, it would be nice to mark the answer as Helpful and your question as Answered.

Dipen Wadhwana
Giga Guru

Hi @vl92 ,

 

Please use variable attributes as max_length=20

 

If my response helps you resolve your issue. Kindly mark it as helpful & correct. 

Thanks,

Dipen