Limit the amount of checkboxes selected on Adobe Acrobat using Javascript?
Hi, I am trying to limit the amount of checkboxes that someone can someone can select on a form i created using Adobe Acrobat Pro DC. Below is the javascript that I am using, however I repeatedly keep getting this error message Syntax Error: missing formal parameter 1: at line 2. Can anyone assist?
Thanks
function limitCheckNumber("check", 0, 26, 3) {
// Initialize the selected check box count
var count = ;
// Loop through the check boxes to see if the limit has been exceeded
for (var i = lower; i < upper + 1; i += 1) {
// Increment the counter if the current check box is selected
if (getField(prefix + "." + i).value !== "Off") count += 1;
// If the count exceeds the limit, deselect the check box that was just selected
// and alert the user
if (count > max) {
event.target.value = "Off";
app.alert("A maximum of " + max + " check boxes can be selected", 3);
break;
}
}
}