Copy link to clipboard
Copied
Good Day.
I am trying to create a adobe form where if I click on the button All Days all checkbox for days will be check.
I when in the properties of All Days under the tab Actions and try to add an action Run a JavaScript
the field name is Check 1 and so on until Check 31
var a1 = this.getField("Check 1");
var a2 = this.getField("Check 2");
a1.value = "On";
a2.value = "Off";
To check the boxes:
for (var i=1; i<=31; i++) this.getField("Check "+i).checkThisBox(0, true);
To uncheck them replace true with false.
Copy link to clipboard
Copied
What's your question?
Copy link to clipboard
Copied
I would like to know the code to be able to check and uncheck the checkbox when I am clicking on All button
Copy link to clipboard
Copied
To check the boxes:
for (var i=1; i<=31; i++) this.getField("Check "+i).checkThisBox(0, true);
To uncheck them replace true with false.