Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How would I use one checkbox to automatically check other checkboxes in a form?

New Here ,
Jun 19, 2018 Jun 19, 2018

I have a PDF form with multiple configuration options that allow submitters to check what they need. But we have one checkbox that requires two others to be selected as well, but users forget sometimes since it is manual.  I'd like to improve the functionality of the form so that when the user selects that first checkbox, Acrobat automatically checks the other two related checkboxes for the user.  How would I go about doing that?

TOPICS
PDF forms
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
New Here ,
Jun 28, 2018 Jun 28, 2018

Assuming Button3 is the checkbox that this script runs on, it will check the checkboxes for Button1 and Button2.  AppAlerts can be used to communicate why the linkages occur.  This doesn't uncheck the values of Button1 and Button2 if Button3 is then unchecked.  If that is necessary, copy/paste the two lines into the ELSE section and change the 'Yes' to 'Off'.

if (this.getField("Button3").value != "Off") {

    this.getField("Button1").value = "Yes";

    this.getField("Button2").value = "Yes";

    //app.alert("Lorem Ipsum...")

}

else {

    //app.alert("Lorem Ipsum...")

}

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 28, 2018 Jun 28, 2018

Assuming Button3 is the checkbox that this script runs on, it will check the checkboxes for Button1 and Button2.  AppAlerts can be used to communicate why the linkages occur.  This doesn't uncheck the values of Button1 and Button2 if Button3 is then unchecked.  If that is necessary, copy/paste the two lines into the ELSE section and change the 'Yes' to 'Off'.

if (this.getField("Button3").value != "Off") {

    this.getField("Button1").value = "Yes";

    this.getField("Button2").value = "Yes";

    //app.alert("Lorem Ipsum...")

}

else {

    //app.alert("Lorem Ipsum...")

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 18, 2023 Apr 18, 2023
LATEST

Can you explain in more detail?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines