RE: Adding two fields and displaying in a third

2002-10-01 Thread Thane Sherrington
At 12:48 PM 9/30/02 -0400, S. Isaac Dealey wrote: >you could also use parseInt(string) or parseFloat(string) although if it >doesn't find an integer or a string at the beginning of the string it will >return "NaN" rather than "". Also if there are non-numeric values on the end >of the string it w

RE: Adding two fields and displaying in a third

2002-09-30 Thread Thane Sherrington
At 02:49 PM 9/30/02 -0400, Mosh Teitelbaum wrote: >Nope, you shouldn't have to. JavaScript is supposed to add 2 values >together (via the + operator) if the values can both be resolved to >numerics. Otherwise, it appends the values. So long as both of your values >are numeric then, it should re

RE: Adding two fields and displaying in a third

2002-09-30 Thread Mosh Teitelbaum
> At 11:22 AM 9/30/02 -0400, Mosh Teitelbaum wrote: > > > onchange="window.document.ExpenseForm.TotalAmount#Line#.value=eval > > > (window.document.ExpenseForm.Mileage#Line#)+eval(window.document. > > > ExpenseForm.CostOfMeals#Line#);" > > > >Add ".value" to the end of the 2 fields you're trying t

RE: Adding two fields and displaying in a third

2002-09-30 Thread S . Isaac Dealey
> At 11:22 AM 9/30/02 -0400, Mosh Teitelbaum wrote: >> > onchange="window.document.ExpenseForm.TotalAmount#Line#.value=eval >> > (window.document.ExpenseForm.Mileage#Line#)+eval(window.document. >> > ExpenseForm.CostOfMeals#Line#);" >> >>Add ".value" to the end of the 2 fields you're trying to add

RE: Adding two fields and displaying in a third

2002-09-30 Thread Thane Sherrington
At 11:22 AM 9/30/02 -0400, Mosh Teitelbaum wrote: > > onchange="window.document.ExpenseForm.TotalAmount#Line#.value=eval > > (window.document.ExpenseForm.Mileage#Line#)+eval(window.document. > > ExpenseForm.CostOfMeals#Line#);" > >Add ".value" to the end of the 2 fields you're trying to add, as in

RE: Adding two fields and displaying in a third

2002-09-30 Thread Pascal Peters
You didn't get the value, but the object: -Original Message- From: Thane Sherrington [mailto:[EMAIL PROTECTED]] Sent: maandag 30 september 2002 17:04 To: CF-Talk Subject: Adding two fields and displaying in a third I'm writing a form that allows a person to fill in the mileage and mea

RE: Adding two fields and displaying in a third

2002-09-30 Thread Turetsky, Seth
forgot the .values on the end of each var, that's why it was putting in [object], should work now. -Original Message- From: Turetsky, Seth Sent: Monday, September 30, 2002 11:19 AM To: '[EMAIL PROTECTED]' Subject: RE: Adding two fields and displaying in a third thane,

RE: Adding two fields and displaying in a third

2002-09-30 Thread Mosh Teitelbaum
> onchange="window.document.ExpenseForm.TotalAmount#Line#.value=eval > (window.document.ExpenseForm.Mileage#Line#)+eval(window.document. > ExpenseForm.CostOfMeals#Line#);" Add ".value" to the end of the 2 fields you're trying to add, as in: ...=eval(window.document.ExpenseForm.Mileage#Li

RE: Adding two fields and displaying in a third

2002-09-30 Thread Turetsky, Seth
thane, it's trying to concatenate them instead of adding, try something like this(forcing the values into numbers then adding them): hth -seth -Original Message- From: Thane Sherrington [mailto:[EMAIL PROTECTED]] Sent: Monday, September 30, 2002 11:04 AM To: CF-Talk Subject: Adding two