When you work with JavaScript, it is important to keep track of the JavaScript console - this is where all JavaScript related errors would pop up. When I toggled the “Double Fee” checkbox, I got this in the console:
ReferenceError: TF is not defined
4:Field:Calculate
This is an indication to what’s wrong: Somewhere, the variable TF is not defined. When I then checked the calculation script for your “Total Fee” field, I see this:
if (this.getField("DF").value === "Yes") {
this.getField("Total").value = (TF*2);
} else {
this.getField("Total").value = TF;
}
The variable TF is used without getting declared or initialized. I see that you have a field named TF at the bottom of the form, so I assume that’s where the not yet doubled fee is coming from. There were a couple other things I needed to correct to make this work. This should work as the calculation script for your “Total” field:
var TF = this.getField("TF").value;
if (this.getField("DF").value === "YES") {
event.value = (TF*2);
} else {
event.value = TF;
}
As you can see, the value for the field that gets calculated is set by assigning to “event.value”, and the return code of your DF radio button group is case sensitive, so you need to check for “YES”.