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

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);


}


}