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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sum two vaues in a form

Status
Not open for further replies.

dark2

Technical User
Sep 11, 2006
44
US
Hi,
Hope this is the right forum. I am new to JavaScripts and I have a form that I want to sum two values from two different fields. I can't figure out what is wrong. Any help greatly appreciated. The two fields I want to sum are 303 and 313. Both are associated to other formulas and the respective formulas work fine. Thanks,

var a = this.getField("303");
var b = this.getField("313");

event.value = (a.value + b.value);


if (event.value > .01)
{
this.getField("32").fgColor=color.black
}
else
{
this.getField("32").fgColor=color.white
}

 
I think "event" may be reserved for, you know, events.

_________________
Bob Rashkin
 
Thanks. I changed to:
var a =

this.getField("303").value +
this.getField("313").value;

this.getField("32").value = a;

if(this.getField("32").value == 0.00)
{this.getField("32").fgColor=color.white}
else
{this.getField("32").fgColor=color.black}

and is working!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top