Copy link to clipboard
Copied
I want to be able to check checkbox 1, then checkbox 2. If both of those boxes are checked I want checkbox 4 to be automatically checked. This is what I have tried but it does not work. Any help would be great. Thanks.
var checkbox1 = this.getField("Checkbox1").value;
var checkbox2 = this.getField("Checkbox2").value;
if (checkbox1 === "Yes" && checkbox2 === "Yes") {
this.getField("Checkbox4").value = "Yes";
} else {
this.getField("Checkbox4").value = "Off";
}
Copy link to clipboard
Copied
Hi,
There must be an error, maybe in the export value of a checkbox ("Yes" spelled wrong???) because the script is correct.
And here you can use either the strict equality symbol (Checkbox1) or the simple equality symbol (Checkbox2).
@+
Copy link to clipboard
Copied
Where did you put this code?
Copy link to clipboard
Copied
Javascipt, mouse up on Checkbox 1 and 2
Copy link to clipboard
Copied
Move it to be the Calculation script of a (hidden) text field.
Copy link to clipboard
Copied
Where does you use the script?
Copy link to clipboard
Copied
In Javascript area from checkbox 1 and 2
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Thank you, will check again. Had some odd things with Acrobat forms lately.
Copy link to clipboard
Copied
Thanks again, I know where I made my "rookie" mistake.