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

Help concerning field validation

RoC1909
Registered: Mar 16 2010
Posts: 2

Hello all,
 
I have a form that contains a table with approximately 10 columns and 20 rows. For two of these columns, the rows (AKA fields) within it are decimal fields w/ 2 leading and 2 trailing digits. I would like these fields to allow a user to ONLY have the ability to enter numbers in the range of 1 to 24.(or be left empty so the range might be 0 to 24), and if a user attempts to place a number outside of this range, a validation message pops up stating so.
 
If anyone can point me in the correct direction to overcome this hurdle, it would be greatly appreciated.
 
RoC1909

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
As it happens, there is a Validate Event for every field on the form. In LiveCycle Designer, open the "Script" Window. Select the field of interest in the design or hierarchy window, and then select "Validate" from the event list. The last value evaluated in the script will be the validation result.

Here is a JavaScript example:

(this.rawValue >=0) && (this.rawValue < 25);

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