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

Form validation message box (Ignore)

umh3
Registered: May 23 2011
Posts: 15

I'm trying to validate a date entry. I have selected a pattern for display and have selected the date formats that are accepted. When I test the PDF and enter an incorrect date a message box appears with an error message and a choice of selecting OK or Ignore. I want to keep the focus on the incorrect field and have the user re-enter a date until it is valid.
 
How is this accomplished? (I cannot javaScript or FormCalc at all. I need everything to be built into LiveCycle...)
 
Thank you for any help!

padobe
Registered: Jun 29 2011
Posts: 10
Please paste this code in the exit event of the DateField:

var text = this.rawValue;
if(text.search(/^[0-9]{2}[/][0-9]{2}[/][0-9]{4}$/)== -1)
{app.alert("Please enter date in DD/MM/YYYY");
xfa.host.setFocus(this);}