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.
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";
}
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?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Use this:
var bChecked = (event.target.value == "decrease")
this.getField("Close7").readonly = bChecked;
this.getField("Close7").value = "Off";
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?
Copy link to clipboard
Copied
Script fixed 'Close7' checkboxes that stay checked if you uncheck 'Option' checkbox.
If you want to hide other checkboxes add them to the script.