I have custom calculation script and I want to change a selected radio button based on the value of the calculation. If the calculation is positive, then use selector1, otherwise, use selector2. (selector1 is checked by default)
Can someone explain how to uncheck 1 radio and check another. I don't have any issues with making the radio buttons the same name (to keep them grouped) however, I don't even know how to control these through javascript. Any ideas?
Code:
var fTotal = this.getField("first_total").value;
var advance = this.getField("advance").value;
var charged = this.getField("charged_atcu").value;
var gTotal = fTotal - advance - charged;
if(gTotal < 0){
this.getField("selector1").checked = false;
this.getField("selector2").checked = true;
}
event.value = gTotal;
Can someone explain how to uncheck 1 radio and check another. I don't have any issues with making the radio buttons the same name (to keep them grouped) however, I don't even know how to control these through javascript. Any ideas?