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

tote values in fields prior to submit

Status
Not open for further replies.

doco

Programmer
Sep 28, 2000
32
GB
Hi,

I have a standard html based form that is used to input
up to five numeric values. But just before the user submits the form I need to total up the given values just for display purposes. I'm thinking this is best done using javascript and outputting the total in a small message window.

Any help would be much appreciated

Thanks,

Chris
 
just add each one to each other :)
but notice that these values are held like strings, so, you have to make a number from them first:

var temp=parseFloat(form.txtfield.value)//for integers - use parseInt
total+=temp

make a loop or may be call adding function from each textfield onchange

"scream" if you'll need further help Victor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top