Hi, I'm using acrobat 8.0 for the mac and I am creating a form where I have an "other" check box. There is a field next to it where the user can type in to be more specific.
Is there a way that makes this text field required only if the "other" check box is checked? And if they uncheck it it no longer is required anymore?
For the Acrobat Form Tool:
/*
Mouse Up Action:
set the "required" property of the "OtherText" field to the
result of the comparison:
"Not" value of the check box value compared to "Off"
if the check box is "Off" (not checked" the result is "false"
if the check box is checked (no matter what value) the result is "true"
*/
this.getField"OtherText").requried = !(this.getField(event.target.name).value == "Off")
Edited to add:
You also might want to add additional code to clear the text field when the check box is unchecked.
For an example in LiveCyclle Designer, see [url=http://forms.stefcameron.com/2007/08/07/what-about-the-other-field/]What About the Other Field?[/url] by Stefan Cameron.
George Kaiser