Here are my needs:
1. Accept only 6 numeric digits
2. Check that all 6 digits are numbers (0-9)
3. Do not allow any character other than 0 through 9
4. Null out the entered value if it is not a 6 digit number
5. Pop an alert
6. Set focus back to the field
I cannot seem to make the Numeric Field allow only 6 digits, and cannot accept the case where the user enters just a "1" and it backfills 0000001, etc. Using a textfield having trouble with a function call.
I am using Acrobat 9.3.3 for all users, and using LiveCycle Desginer ES2 9. Most of the examples I find on the net seem touse depricated functions, so at a loss how to do this. This is NOT an HTML page but a PDF form.
Ideally it would be a function I call at an EXIT event from the field and do the test. The Null and alert I can handle fine. Just can't seem to get the function right.
ZNum is the textfield name.
Any help is appreciated.
Thanks
var patt1=/^\d{6}$/i;
You can then use the test() method on a string to make sure if conforms to the expression (which it will only do if it is made out of six digits, and nothing more, or less). You do that like so:
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com