> 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#Line#.value)+...
                                                          ^^^^^^

BTW, why are you using "eval()?"

--
Mosh Teitelbaum
evoch, LLC
Tel: (301) 625-9191
Fax: (301) 933-3651
Email: [EMAIL PROTECTED]
WWW: http://www.evoch.com/


> -----Original Message-----
> From: Thane Sherrington [mailto:[EMAIL PROTECTED]]
> Sent: Monday, September 30, 2002 11:04 AM
> 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 meal
> expense, and then displays the total in a third field.  I'm using this in
> the meals expense field:
>
> <input type="Text" name="CostOfMeals#Line#" value="0" validate="float"
> required="Yes" size="5" maxlength="5"
> onchange="window.document.ExpenseForm.TotalAmount#Line#.value=eval
> (window.document.ExpenseForm.Mileage#Line#)+eval(window.document.E
xpenseForm.CostOfMeals#Line#);">
>
> But the third field evaluates to [object][object].  How do I get this to
> add up?
>
> T
>
> 
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to