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

A running sum total of amts. on a form

Status
Not open for further replies.

budapestnori

Technical User
Jan 15, 2004
33
HU
I have a web page that I have taken as far as I can. Can someone show me how to accomplish what is what I am obviously trying to do on this page:

You will see each image has a spot for current Image Total. This figure will need to be able to be changed up or down dynamically. It would also be nice at page top to have a cumulitatve total.

I would think that to do this, I might pass the js func an id number, such as 234 to be used as an indice for the each images form fields total value name. As in 234_tot_cost, 435_tot_cost, 4323_tot_cost. Then, as with each onChange, either add or subtract that amount from the total. But how do I disern if the total is to be increased or descreased? Say they chose 2 8x10's, and 5 4x6's. The total will be "x". But then they go back and change the number of 4x6's to 3. The only way I can think to address this is to each time assign the value of the sum values for each form element for that image. In other words, every time an onChange activates the func, cycle through each of the other 5 elements pertinent to that image, resulting in a new total... Am I warm?
 
Very interesting, on the surface it looks like something I can use, I will have to try it though. One difference in it and what I am doing, is this script works on the premise of the qty for 1 widget, etc. I have 1 image which users can choose multiple qty of multiple sizes...for the 1 image...
Will it still work do you think?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top