bigblock454
MIS
Hi All, I need help dealing with a "0" value and division. I have 4 fields in a form that take a value from another field and either divide that value by 4, or return a "0" value. I tried to trick it by assigning a variable as "1", but this is not working correctly and I am not a JS programmer, more of an at-need wannabe. So...Here is the script (var b is one of each of 4 fields, so that changes), any assistance would be invaluable!
var a = this.getField("TotalCommission2");
var b = this.getField("Up1");
//or Demo1, Contract1, etc
if ((b.value == 0)) {
event.value = 0
} else {
var d = (a.value/4)
var c = 1
event.value = d*c
}
var a = this.getField("TotalCommission2");
var b = this.getField("Up1");
//or Demo1, Contract1, etc
if ((b.value == 0)) {
event.value = 0
} else {
var d = (a.value/4)
var c = 1
event.value = d*c
}