Skip to main content
Participant
December 1, 2017
Answered

Checking Checkbox when I am clicking button All

  • December 1, 2017
  • 1 reply
  • 589 views

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";

    This topic has been closed for replies.
    Correct answer try67

    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.

    1 reply

    try67
    Community Expert
    Community Expert
    December 1, 2017

    What's your question?

    esaumureAuthor
    Participant
    December 1, 2017

    I would like to know the code to be able to check and uncheck the checkbox when I am clicking on All button

    try67
    Community Expert
    try67Community ExpertCorrect answer
    Community Expert
    December 1, 2017

    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.