Show a field if all checkboxes are checked
I have a PDF checklist with 12 checkboxes named Pass1.0, Pass1.1 and so on up to Pass1.11.
There's a Visible text field called CompletePrompt at the top of the page on top of a Hidden signature field.
There is a Sign Checklist button at the bottom of the page. When clicked, the following js runs:
this.getField("CompletePrompt").display = display.hidden;
this.getField("ReviewerSignature").display = display.visible;
this.getField("ReviewerSignature").setFocus();
this.getField("ReviewerSignature").strokeColor = color.red;
I want this to happen if and only if every one of the 12 checkboxes is checked. If even one box is blank, I want the script to end and trigger an app.alert without toggling the visibility of the other fields.
My current effort ended in:
var f = this.getField("Pass1");
if (f.valueAsString == "Off") {
app.alert({cMsg:"Check all Checkboxes to Sign"});
} else if (f.valueAsString == "Yes") {
this.getField("CompletePrompt").display = display.hidden;
this.getField("ReviewerSignature").display = display.visible;
this.getField("ReviewerSignature").setFocus();
this.getField("ReviewerSignature").strokeColor = color.red;
}
What am I doing wrong here?
