go4java
asked on
Acrobat 6: Field validation
I need to validate a field onBlur with JScript:
- should be numeric (1 to 9999999999)
- spaces should be trimmed
Thanks.
- should be numeric (1 to 9999999999)
- spaces should be trimmed
Thanks.
ASKER
Is more a regular expression: The first char should be 1 to 9 (not 0!) and the follwoing 9 chars should be 0 to 9.
Examples:
123456
234
99999999
Examples:
123456
234
99999999
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you,
I found the workaround:
1. onBlur
- conversion if field content to String! (--> 01 will not be parsed to 1)
var sNodeString = sNode.valueAsString;
2. Test field content with regular expression
var regExpr = /^[1-9][0-9]{0,9}$/;
I found the workaround:
1. onBlur
- conversion if field content to String! (--> 01 will not be parsed to 1)
var sNodeString = sNode.valueAsString;
2. Test field content with regular expression
var regExpr = /^[1-9][0-9]{0,9}$/;
If this is not sufficient, I can give you more information about how to do this with JavaScript.