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

Adding values of dynamically generated rows

Status
Not open for further replies.

sharapov

MIS
May 28, 2002
106
US
Hello,

It seems that I hit a brick wall and need your help. I am generating a table from a database and I want to be able to sum one of the columns and display the result once the page loads. Look at the sample table here ( Also I want total value to update if user makes change to one or all of the fields in that column. I can't use T1.value + T2.value (for example) because as I said all data is taken from database, and I simply don't know which Item is going to show up. Can anybody help me with this?

Thanks.
 
According to the source of the page, your input fields have the same name "T1". At least, they should be difference, such as T1, T2, T3
Aslo:
1) Add FORM tag around the table. It is not necessarily sometimes, but some browser will ignore the input field without FORM
2) Add javascript function that sums up the fields and puts result into result field
3) Call this function from page onload and from onblur event for each calculated field

Regards,
Sergey Smirnov
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top