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

Checkbox

Explorer ,
Oct 01, 2021 Oct 01, 2021

Copy link to clipboard

Copied

Okay this is a little tricky to explain. I have 2 checkboxes with the same field name ("Option") but different export values ("close" or decrease"). Depending on which you option you select there are 3 more checkboxes that come up. Those 3 checkboxes all also have the same field name ("Close7") and different export values ("bal", "nobal", and "payoff"). All checkboxes and their text will be hidden if the "close" Option is not selected.

 

However, I have more hidden fields off of those 3 checkboxes. My issue is that if we select the any of those three boxes, but then change our mind and want to select Option "close" then it doesn't uncheck any of the three "Close7" fields. It will hide them, so you can no longer see them, but it doesn't uncheck it.

 

I want any of the "Close7" fields to uncheck if the "Option - close" box is selected. However, I do NOT want those three boxes automatically checked when the "Option - decrease" is selected. Can someone help me?

 

I attached a sample copy of my document with all of the mapping that I have set up. Here is a quick preview so you can see what I am talking about.

defaultrfjue3aoi30b_0-1633119103927.png

 

 

TOPICS
Create PDFs , Edit and convert PDFs , General troubleshooting , How to , JavaScript , PDF forms

Views

661

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
Explorer ,
Oct 01, 2021 Oct 01, 2021

Copy link to clipboard

Copied

I have tried to enter this mapping on the Actions tab as Mouse Up - Run a JavaScript. It did not work for me

 

var bChecked = (event.target.value == "decrease")
this.getField("Close7").readonly = bChecked;
if(bChecked)
{
this.getField("Close7").value = "Off";
}

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 ,
Oct 01, 2021 Oct 01, 2021

Copy link to clipboard

Copied

Your code seems fine. Are there any error messages in the JS Console when you use it? Can you share the actual file with us?

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
Explorer ,
Oct 04, 2021 Oct 04, 2021

Copy link to clipboard

Copied

Hi,

 

I did share the attachement with the original post. But I am attaching it here for you.

 

Thanks!

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 ,
Oct 04, 2021 Oct 04, 2021

Copy link to clipboard

Copied

Use this:

var bChecked = (event.target.value == "decrease")
this.getField("Close7").readonly = bChecked;
this.getField("Close7").value = "Off";

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
Explorer ,
Oct 06, 2021 Oct 06, 2021

Copy link to clipboard

Copied

No, that doesn't work. The fields that show up once one of the "Close7" boxes are checked still show up.

 

Is there a way to make it so that if I am selection the "decrease" choice for the "Option" checkbox that a fillable field can have the information automatically enetered once checked, but if the "close" Option is selected then nothing would show up in that box?

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 ,
Oct 06, 2021 Oct 06, 2021

Copy link to clipboard

Copied

LATEST

Script fixed 'Close7' checkboxes that stay checked if you uncheck 'Option' checkbox.

If you want to hide other checkboxes add them to the script.

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