Copy link to clipboard
Copied
I have a simple IF statement in pdf fillable form. If a checkbox is checked, then "See Below" will display in another field. Works great! However, when I uncheck the box, the field still displays the message and doesn't go blank. Even the Clear Form doesn't clear the field. HELP! Thanks.
So then, this must be a calculation script on the field that is displaying the "See Below" text? It's extremly important that we know where the script is being run.
There are a few problems with the script, it's not that close.
1. the comparison operator is "=="
2. is the export value from the checkbox 1? This is also crtical information.
3. There is no variable named CRO, the vaiable containing the checkbox value is named TEST.
Here is a calculation script that will work regardless of
...You can use something like this as custom calculation script of text field:
var cList = [
"Text for checkbox1",
"Text for checkbox2",
"Text for checkbox3",
"Text for checkbox4",
"Text for checkbox5"
];
event.value = "";
for(var i=0; i<=4; i++){
var f = this.getField("Check Box"+i).valueAsString;
if(f !== "Off")
event.value += cList[i]+"\n";}
This assumes checkboxes are named "Check Box0","Check Box1",...etc, you can add more checkboxes just change to correct number in loop.
Copy link to clipboard
Copied
What script does you use?
Copy link to clipboard
Copied
I am very new to using script, so hope I am not too far off! CRO is a checkbox for a class running outside business houirs.
var TEST = this.getField("CRO").value;
if( CRO = 1) event.value = "See Below"
else event.value = ""
Copy link to clipboard
Copied
So then, this must be a calculation script on the field that is displaying the "See Below" text? It's extremly important that we know where the script is being run.
There are a few problems with the script, it's not that close.
1. the comparison operator is "=="
2. is the export value from the checkbox 1? This is also crtical information.
3. There is no variable named CRO, the vaiable containing the checkbox value is named TEST.
Here is a calculation script that will work regardless of the export from the checkbox.
var TEST = this.getField("CRO").value;
if( TEST != "Off") event.value = "See Below";
else event.value = "";
Copy link to clipboard
Copied
PERFECT! I am so glad you are there to help!
Copy link to clipboard
Copied
You're welcome. I'd be helpful if you marked my answer as Correct.
Copy link to clipboard
Copied
Hi Thom,
I am new to scripting in Adobe. I am trying to make a form, that has a list of items that has checkboxes next to them. What I want to happen is when a checkbox is checked, some specific text will fill a text box below the list. And as other items are checked, specific text for them are added to the text box.
Is this possible?
Thanks!
Copy link to clipboard
Copied
You can use something like this as custom calculation script of text field:
var cList = [
"Text for checkbox1",
"Text for checkbox2",
"Text for checkbox3",
"Text for checkbox4",
"Text for checkbox5"
];
event.value = "";
for(var i=0; i<=4; i++){
var f = this.getField("Check Box"+i).valueAsString;
if(f !== "Off")
event.value += cList[i]+"\n";}
This assumes checkboxes are named "Check Box0","Check Box1",...etc, you can add more checkboxes just change to correct number in loop.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Please provide the script that is used for this action, and be specific about where the script is triggered. For example, is the script in the MouseUp Action for the checkbox?
Copy link to clipboard
Copied
The script is in the Calculation of the Test Field.