Copy link to clipboard
Copied
I would like to perform a check whenever the pdf is closed and display an alert if one of the check boxes in the document is not ticked.
My problem is that the validity of certain textboxes should be checked in connection with the value selected in a specific radio button.
I thought to use this code in Document will close, but i think i got the syntax wrong, as I get an error.
if(
this.getField("CheckBox1").value == "Off" ||
(this.getField("RadioButton").value == "Choice1" && this.getField("CheckBox2").value == "Off")
) {
app.alert("Not all check boxes are ticked!",3,0, "Attention!");
}
What should I change?
Thanks!
Copy link to clipboard
Copied
What error does you get?
Copy link to clipboard
Copied
It just says "Syntax Error: syntax error 8"
Copy link to clipboard
Copied
Try this:
Execute the script in the Javascript console.
Copy link to clipboard
Copied
Thank you! It appears that I was using too many ||, and not enough ), but it works correctly now.
The other problem I got into now is that my code is 104000 characters long and it does not fit in the Java Script Editor. Is there any workaround that?
Copy link to clipboard
Copied
You can use a external text editor