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

Checking box checks a second and hides a third

New Here ,
Jun 27, 2020 Jun 27, 2020

Copy link to clipboard

Copied

Hi all,

 

I'm a complete novice, so this is probably really simple, but I cannot find a similar problem listed.

 

I'm creating a form where if the user, prior to sending to a client, checks the NoFee box this will hide CardYes but check CardNo.

 

However, if the NoFee box is not checked, CardYes becomes shown (and this is then a required field) and CardNo is hidden.

 

Can anyone help me?

TOPICS
Create PDFs , How to

Views

488

Translate

Translate

Report

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

correct answers 1 Correct answer

Community Expert , Jun 29, 2020 Jun 29, 2020

I will answer your question  using the JavaScript example the Max Wyss posted in the following  thread a long while ago: https://answers.acrobatusers.com/show-hide-multiple-fields-based-on-a-check-box-and-then-make-them-show-again-q299956.aspx

 

You need a mouse up action javascript in the "Nofee" checkbox.

 

In edit mode, right-click on that checkbox field select Properties from the context menu.

 

This will open the Checkbox Properties dialogue box where you will then click on the "Actions" tab.

 

Fol

...

Votes

Translate

Translate
Community Expert ,
Jun 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

I will answer your question  using the JavaScript example the Max Wyss posted in the following  thread a long while ago: https://answers.acrobatusers.com/show-hide-multiple-fields-based-on-a-check-box-and-then-make-them-s...

 

You need a mouse up action javascript in the "Nofee" checkbox.

 

In edit mode, right-click on that checkbox field select Properties from the context menu.

 

This will open the Checkbox Properties dialogue box where you will then click on the "Actions" tab.

 

Follow the slide below:

 

noFee.png

 

After you've clicked on "Add" use the code I am posting here for you (or modify as desired):

 

if (event.target.value !="Off") {
this.getField("CardYes").display = display.hidden; 
this.getField("CardYes").checkThisBox(0,false);
this.getField("CardNo").display = display.visible;
this.getField("CardNo").checkThisBox(0,true);

} else {

this.getField("CardYes").display = display.visible; 
this.getField("CardYes").checkThisBox(0,true);
this.getField("CardNo").display = display.hidden;
this.getField("CardNo").checkThisBox(0,false);

}

 

Click close to exit this dialogue box , and you should be good to go.

 

Votes

Translate

Translate

Report

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 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

Hi ls_rbls,

 

Thanks for coming back to me. 

 

After following your solution I then had an issue when I'd assigned CardYes to signer1, but this appears to be because this changes the name of the field to CardYes_es_:signer1. So when I've replaced CardYes with CardYes_es_:signer1 in your code this works perfectly.

 

Thank you so much!

Votes

Translate

Translate

Report

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
Community Expert ,
Jun 29, 2020 Jun 29, 2020

Copy link to clipboard

Copied

LATEST

Your welcome.

Votes

Translate

Translate

Report

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