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

Obligatory checkbox

watson23
Registered: Mar 25 2008
Posts: 37
Answered

Hi,
is there any way to make a checkbox on a form obligatory? So it would have a red border and e.g. clicking a submit button would cause some kind of alert if the checkbox is unchecked?
Thanks in advance
Regards
T.M.

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Yes, but it's a bit awkward. Since the checkbox is a binary value, it's not typically considered something you'd make requred, and the "Required" option is not provided. You have to edit the XML to put the option in.

First though, in the "Options->Binding" tab for the checkbox, delete the "Off" value, so that "off" for the check box is a null value.Next, add a text field to the document and make it required. With the text field selected switch to the XML view. Scroll down to the bottom of the text feild tab and you'll see an entry for the "validate" event. It'll have a "nulltest" property. Copy this line to the same location in the checkbox's field tag. Switch back to design view and accept the changes. Now delete the text field you created.

That's it. When the user tries to do the submit they'll get the checkbox flagged and highlighted as required, just like the other required fields.

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