Copy link to clipboard
Copied
I have an Interactive PDF form. On this form I have a small group (7 options)of checkboxes. 2 of the boxes are directly associated with each other (one way relationship)
These 2 checkboxes are Network and Infrastructure (dependent upon Network).
The scenarion is the following:
I currently am using the following script on Mouse Up:
Var f = this.getField("cr_infrastructure");
If (event.target.isBoxChecked(0,true))
{ f.checkThisBox(0,true);}
Else
{f.checkThisBox(0,false);}
Copy link to clipboard
Copied
That script will not work, it should be 'var', 'else', 'if' not 'Var', 'Else', 'If' it's case sensitive.
To do what you want, you will need to have custom calculation script placed in any text field.
What is the exact name of Network checkbox?
Copy link to clipboard
Copied
Nit sure what you mean by not gonna work. I have the order just like you stated and Actually the script does work for checking and unchecking the Infrastructure check box when the Network check box is clicked and unclicked.
I have never done a calculated script before and the name of the Network checkbox is cr_Network.
Copy link to clipboard
Copied
The issue is not the order but the spelling. It's "var" not "Var", "if" not "If", etc. Your code as you posted it will produce multiple error messages. I assume that's not really your code, or it wouldn't work at all. It was probably modified when you copied it to something like Word before posting it here.
Copy link to clipboard
Copied
Oh I understand what you are getting at. You are correct that isn't my exact code. I typed it using my phone. The code I have is in correct lowercase
Copy link to clipboard
Copied
If you have in your script 'var', else', 'if' it will work but script you posted will not work.
Use this as 'Mouse UP' action of "cr_infrastructure" checkbox:
var net = this.getField("cr_Network");
if(net.isBoxChecked(0)){
app.alert("Please uncheck Network checkbox first.",3);
event.target.checkThisBox(0);}
Copy link to clipboard
Copied
Ok i will give that a go and let you know. Thank you very much.
Copy link to clipboard
Copied
That worked perfectly thank you
Find more inspiration, events, and resources on the new Adobe Community
Explore Now