These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Help with Validating

NH-Matt
Registered: Jun 17 2008
Posts: 13
Answered

Is it possible to have only the acceptable range of user entered data into a numeric field be displayed?

Currently it has a validation script to check if the value is between a certain range but I would like to only allow the acceptable range fill the field. Anything outside the the acceptable range, the field will remain empty.

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
By using the change event you can moniter and modify data entry as it happens. There are several event properties that hold information about the interactive data entry,

xfa.event.change, xfa.event.prevText, xfa.event.newText, xfa.event.selEnd, and xfa.event.selStart

For example, enter this code into the change event for the entry field. It refuses to enter a value greater than 42.
if(Number(xfa.event.newText) > 42){xfa.event.change = "";xfa.event.selEnd=0 ;xfa.event.selStart=0 ;}

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/]http://www.adobe.com/devnet/acrobat/[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script