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

How to dynamically add up text input elements

Status
Not open for further replies.

dip

Programmer
Aug 15, 2000
20
SG
Hi,

<input type=&quot;text&quot; name=&quot;mark1&quot;> (just say i have four of these in the same page)...i am supposed to send 4 elements with the same name to the next page. Each of these element will have a number input from the user & when it is submitted to the next page, i have to add these numbers up & average them. That is no problem. The problem is, the number of elements are dynamically generated (from 4 - 9). how can i do the calculation ?
 
If you give all the &quot;input fields&quot; the same name, you will get a list of values on your &quot;action&quot; page.

Loop through the list and perform your calculations.

(A little CFLOOP background)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top