Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Value comparison must return greater value returns no value

Status
Not open for further replies.
Sep 12, 2007
143
US
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
}
}



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top