The CreatorCon Call for Content is officially open! Get started here.

How max length for a text field is enforced

pbo
Mega Expert

When I add a new text field to a table (incident for example) and choose Small (40) or Medium, I may not add more than 40 (100) caracters in this field

But if you choose Large (1000) or X-Large (4000), I may add as many caracters as I want

Is it possible to modify this ?

1 ACCEPTED SOLUTION

nthumma
Giga Guru

If its greater than 255 , SN assigns as large data type in the back end.



We use client script to restrict this. below is the script.



var control = g_form.getControl(fieldName);


if (control.value.length > mLength){


g_form.hideErrorBox(fieldName);


g_form.showErrorBox(fieldName, 'You have reached the maximum limit of ' + mLength + ' characters for this field.');


control.value=control.value.substring(0,mLength);


}


else{


g_form.hideErrorBox(fieldName);


}


}


View solution in original post

5 REPLIES 5

Uncle Rob
Kilo Patron

Good question.   Back in 1912 when I first started using SN the fields would automatically adjust their size, and you had to build your own hard-stops.


Jaspal Singh
Mega Patron
Mega Patron

sachin_namjoshi
Kilo Patron
Kilo Patron

Hi Patrick,



You can define client script for your field and don't allow user to submit more than desired number of characters.



Regards,


Sachin


Somveer Karhan1
Giga Expert

Hi Patrick,



You may open the dictionary entry for the field and specify Max Length (numeric) of your choice. Make it 0, if you don't want to limit the length.



find_real_file.png