Copy link to clipboard
Copied
I have a PDF form that I need to make a specific set of calulations on.
The form has a series of tick boxs that when ticked, add a specific value to their corresponding fields.
(I've managed to do this using Javascript).
These fields are then totalled up in another field.
(I've done this using the 'caluculate' feature in PDF forms).
This all works OK, however my problem is that I need those values to zero out when those fields are unticked and I cannot figure out how to do this.
You need to put the commands in a code block (surrounded by curly brackets), first of all. As it stands, only the first line is associated with the if-condition. The second one will always be executed. Replace it with this code:
if (event.target.value!="Off") {
this.getField("CPSR value OUT").value=this.getField("CPSR value IN").value;
this.getField("CPSR RB value OUT").value=this.getField("CPSR RB value IN").value;
} else {
this.getField("CPSR value OUT").value="";
this.getField("CPSR RB
...
Copy link to clipboard
Copied
Post your code for the first step.
Copy link to clipboard
Copied
if (event.target.value!="Off")
this.getField("CPSR value OUT").value=this.getField("CPSR value IN").value
this.getField("CPSR RB value OUT").value=this.getField("CPSR RB value IN").value;
Copy link to clipboard
Copied
You need to put the commands in a code block (surrounded by curly brackets), first of all. As it stands, only the first line is associated with the if-condition. The second one will always be executed. Replace it with this code:
if (event.target.value!="Off") {
this.getField("CPSR value OUT").value=this.getField("CPSR value IN").value;
this.getField("CPSR RB value OUT").value=this.getField("CPSR RB value IN").value;
} else {
this.getField("CPSR value OUT").value="";
this.getField("CPSR RB value OUT").value="";
}
Copy link to clipboard
Copied
Thanks that worked perfectly.