Expand my Community achievements bar.

Validate that user should not enter more than specified number of digits/chars?

Avatar

Level 8

Hello

First case: I have placed a TEXT field on the form. Now i want to put the below validation,

1) User has to enter only numbers (no decimals)

2) Only 10 digits

If not i need to

1) Alert app.alert

2) Make the field either CLEARIng or considering & resetting only the first 10 digits (if user entered more than 10 digits)

2nd case: Same as above, a TEXT field, but, the data is with a DECIMAL notation, the allowed lenghts are as

2 digits as prefix to decimal

2 digits as suffix to decimal position

example, 35.88

Pls. let me knw the Java Script for these 2 cases or do you suggest me PATTERN validation if so, can i CLEAR or reset  and if so, pls. let me know under which TAB(Display / Edit / Data) i need to put the PATTERN validation?

0 Replies