Hi,
Could somebody help me with the regular expression for the following validation of a text field?
1) Total characters in the text field should be limited to 15 (including decimal part if any)
2) The total number of digits after the decimal point (trailing digits) is not more than 5 (however, the decimal part is not mandatory)
The valid values are :
123456789.12345
1123456789.1234
123456789123456
123456789123.10
12345
12345.152
1.12345
The invalid values are :
12345.123456
12345678.1234589
0.1234567
Please Note : Due to some reasons i dont want to go for either a decimal or numeric field. I want to use only a text field.
Thanks,
VJ
Solved! Go to Solution.
Views
Replies
Total Likes
Put this in your field's change event:
if (!/^\d{1,9}(\.\d{0,5})?$/.test(xfa.event.newText))
xfa.event.change="";
Kyle
Views
Replies
Total Likes
Put this in your field's change event:
if (!/^\d{1,9}(\.\d{0,5})?$/.test(xfa.event.newText))
xfa.event.change="";
Kyle
Views
Replies
Total Likes
Thanks dcidev.
It works fine.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies