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

Form validation for multiple values from another field

shawnash
Registered: Dec 16 2009
Posts: 48

I am not sure if this is possible - but here is my question. I am using Adobe Acrobat 5 - I have 2 fields. One is called Grade and the other is called Rate. I want to check the value of the Grade field and if the value is 10 then I want to allow a range of 10.00 to 19.99 in the field of Rate. If the value is 20 then I want to allow a range of 20.00 to 29.99 in the field of Rate, etc... I know this will need to be a custom validation script, but do not know how to code it. Does anyone know how I could accomplish this? Thank you in advance.

Shawn

My Product Information:
Acrobat Standard 5.x or older, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You're code should be something like this:
// First get the value from the Grade fieldvar nGrade = this.getField("Grade").value; // Now do the validation.if(nGrade == 10)event.rc = (event.value >= 10) && (event.value <20);else if(nGrade == 20)event.rc = (event.value >= 20) && (event.value <30);

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/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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

shawnash
Registered: Dec 16 2009
Posts: 48
Thanks, that worked.