Hi:
I have a numeric field on my form that I need to limit the number of numbers entered to 4 only. The field can have leading zeros... Is their someway to do this?
Solved! Go to Solution.
Views
Replies
Total Likes
I send you the code for NumericField only..
.length is a java script method which returns the length..
The error you got may be because you have not set your scripting language to Java Script and the code should be in Change event..
Attached is the sample..
https://acrobat.com/#d=4yJTgBa-x9Hn-bEbb0VV-w
Thanks
Srini
Views
Replies
Total Likes
The below code can check for the Field length and does not allow the user to enter more.
Place it in the Change event of the Numeric Field with java Script as language..
//This is the length you want your NumericField to accept. If you want to add additional leading zeros then you need to set the length accordingly.
var maxLength = 4;
if(xfa.event.newText.length >maxLength)xfa.event.change = "";
Thanks
Srini
Views
Replies
Total Likes
Thanks for the post... However, .length was not a member of
newtext. Also, the field is of type numeric .... any other suggestions?
Views
Replies
Total Likes
I send you the code for NumericField only..
.length is a java script method which returns the length..
The error you got may be because you have not set your scripting language to Java Script and the code should be in Change event..
Attached is the sample..
https://acrobat.com/#d=4yJTgBa-x9Hn-bEbb0VV-w
Thanks
Srini
Views
Replies
Total Likes
The code needs to go on the change event.... It worked like a champ at that point.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies