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

On Blur Event of a button

Lady Di
Registered: Feb 18 2009
Posts: 86

I currently have a form that contains buttons labeled "". When the user clicks on these buttons, a calendar appears. The user selects a date from the calendar and the caption on the button changes to reflect the date the user picked. I want to force the user to select a dat and not leave the caption "". Below is the code I tried putting on the On Blur event of the button, but it is not working. How can I for the user to select a date?

// Form Validation, the out code below identifies fields that
// are not ready for submission and reports the errors

var patternEmpty = /^\s*$/;
var strMissing = "";
if(patternEmpty.test(this.getField("dateField.0").caption ==””))
strMissing = "dateField.0";
else
{ // All is ok, submit the data
console.println("All form data ok");
}

if(strMissing.length)
{// Got an error
app.alert("Missing Form data in field: " + strMissing);
}

My Product Information:
Acrobat Pro 8.0, Windows
jimhealy
Team
Registered: Jan 2 2006
Posts: 146
To keep from leaving a field, you need to use a custom validation script.

Jim Healy
FormRouter, Inc.
Check out our FREE Advanced Acroform Toolset:
http://www.formrouter.com/tools

Jim Healy, Founder & CEO FormRouter Inc.
Chapter Leader AUG RTP NC
http://www.formrouter.com