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

Validate radio button and drop list using event.target.mailDoc

brennanhobart
Registered: Oct 9 2007
Posts: 37
Answered

I'm using this script (see below) in a custom button in the click event floating above the event.target.mailDoc function and it's working great to validate the input of fields and a check box. Does anyone know how to get else if(FirstName.rawValue=="" || FirstName.rawValue == null) to validate a radio buttons and a drop down menu? I didn't see any documentation on the process. Thanks, Brennan.

if(LastName.rawValue=="" || LastName.rawValue == null) {
xfa.host.messageBox("Please enter the employee's last name.");
}
else if(FirstName.rawValue=="" || FirstName.rawValue == null) {
xfa.host.messageBox("Please enter the employee's first name.");
}
else if(IAgree.rawValue == 0) {
xfa.host.messageBox("Please agree to the terms.");
}
else {
event.target.mailDoc({bUI:false, cTo:"umcdoittigerlinkrequests [at] missouri [dot] edu", cCc:SignatoryEmail.rawValue, cSubject:"Long-distance or calling card contract request/change/cancel submitted to the Division of Information Technology", cMsg:""+ContactName.rawValue+" submitted an order to request/change/cancel long-distance or calling card service from the Division of Information Technology for "+FirstName.rawValue+" "+LastName.rawValue+", using the MoCode:"+MoCode.rawValue+". Please open the attached PDF file and review the request in Adobe Acrobat. If you did not approve this request or if you think the order is not accurate, please notify the Division of Information Technology front desk by calling (573)882-2000."});
}

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
When the check box is checked it has a value of 1, when it is unchecked it has a value of 0. Unless of course you change the on and off values your code should work fine.

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

brennanhobart
Registered: Oct 9 2007
Posts: 37
Thom: Worked perfect! I appreciate your help, thanks so much. Brennan