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 will

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): input type=Text name=CostOfMeals#Line# value=0 validate=float required=Yes size=5 maxlength=5 onchange= var num1=new

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:

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, it's trying

RE: Adding two fields and displaying in a third

2002-09-30 Thread Pascal Peters
You didn't get the value, but the object: input type=Text name=CostOfMeals#Line# value=0 validate=float required=Yes size=5 maxlength=5 onchange=window.document.ExpenseForm.TotalAmount#Line#.value=eval(windo w.document.ExpenseForm.Mileage#Line#.value)+eval(window.document.Expense

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 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, as in:

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 to add, as in:

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