bigblock454
MIS
Hi All, I'm trying to write a very simple script that will compare 2 values and return the greater of the two in a PDF form. So far, nothing I try will return a value.
It is a sales commission worksheet, where MinCommDue is a manually entered value that may or may not be populated (but is for my testing).
AllComs is a hidden field that is the sum of 4 other fields.
I need to compare the values and place whichever is greater in a different field.
I am very inexperienced in JS, any help would be greatly appreciated.
Here is the script:
var a=this.getField("MinCommDue");
var b=this.getField("AllComs");
if ((a.value >= b.value)){
event.value = a
} else {
if ((a.value <= b.value)) {
event.value = b
}
}
It is a sales commission worksheet, where MinCommDue is a manually entered value that may or may not be populated (but is for my testing).
AllComs is a hidden field that is the sum of 4 other fields.
I need to compare the values and place whichever is greater in a different field.
I am very inexperienced in JS, any help would be greatly appreciated.
Here is the script:
var a=this.getField("MinCommDue");
var b=this.getField("AllComs");
if ((a.value >= b.value)){
event.value = a
} else {
if ((a.value <= b.value)) {
event.value = b
}
}