How to Limit the number of Checkboxes selections in Adobe Acrobat?
Good day!
I have a fillable PDF with 7 checkboxes, namely CB1 to CB7.
I wish to limit the number of checkboxes selected to only 2. I searched YouTube for a solution and this is the script I should place in Custom Calculate script in the Text Field I created ...
if (event.source && /^cb\d$/.test(event,name)) {
var counter =0;
for (var i=1; i<=7; i++) {
of (this.getField("cb"+i).value!="Off")
counter++;
}
If (counter>2) (
app.alert("Error: Maximum 2 Checkboxes are allowed.");
this.resetForm([event.source.name]);
}
}
However, I am getting a syntax error. I hope someone can help me with this Java script.
Thank you in advance.
