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

Validation

Anonymous
Answered

Hi all,
 
I was hoping someone could help me, any help would be greatly appreciated:-)
 
I have a text field called "userAnswer" which the user enters their answer in, i then have a field called "userScore"
 
I am trying to create a validation script that if the user enters the words 50% anywhere inside the userAnswer text field, then the userScore field will display "Correct".
 
Any help would be great, thank you:–)

My Product Information:
Acrobat Pro 9.3.1, Macintosh
try67
Expert
Registered: Oct 30 2008
Posts: 2398
You can place this code as the custom validation script of userAnswer:

if (event.value && event.value.match("50%")!=null) {
this.getField("userScore").value = "Correct";
} else this.getField("userScore").value = "";


- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

smitchell15 (not verified)
Pure Genius! Thank you very much, that saved me a lot of pain! Thank you very much again:-)