Hi
I am trying to use JavaScript to read a check box's value, and, if it is "1" then make a text field visible (text field is initialized as presence = "invisible"), and if the check box's value = "0" then continue to keep the text filed box invisible.
The form is saved as a dynamic 8 XML pdf. The script for click of the check box is:
if (CheckBox1.rawValue = "1")
{
TextField1.presence = "visible"
}
else
(CheckBox1.rawValue = "0")
{
TextField1.presence = "invisible"
}
This works OK.
The problem: there are several check boxes, each of which, if checked, causes a single text field box to become visible. If the user unchecks one of these but leaves another checked, it should still display the text field box. But, unchecking any one of the check boxes, makes the text field box invisible. What the form needs is for the text field box to dispaly if any of the check boxes are checked.
I tried adding an "or" to the script with no success:
if (CheckBox1.rawValue = "1")|(CheckBox2.rawValue = "1")
{
TextField1.presence = "visible"
}
else
(CheckBox1.rawValue = "0")
{
TextField1.presence = "invisible"
}
If I add the | (CheckBox2.rawValue = "1"), the text box no longer displays when either check box1 or check box 2 are checked. Nothing works using this.
I've tried changing the values for each check box to other numbers (for example "2"). I've tried using == instead of =, and || instead of |. Nothing helps.
I must be doing something wrong in the script or setting.
I'm stuck and would appreciate any help.
Kind Regards,
Stephen