bbrant
10-02-2006, 08:35 PM
I have a form that pulls from a database. One of the form values shows a number (percent) for that particular row. I have a variable that adds the form values and then using a cfoutput (I’m using ColdFusion MX), I can display the total of these percentages. The total of all the percentages needs to add up to 100%. This is all done using only ColdFusion.
On the form, users can change the value of the any of the numbers/percentages. I have an onChange as part of the text box that, when the value is changed, the form will submit and write to the database to give the new total.
What I would like to do is have a “real-time” total that displays the added values of all the percentages without having to submit the form. I’m sure this is possible using Javascript but I’m not sure how. Can anyone point me to an example or give me some advice? The number of rows can/do vary so I can’t “hardcode” something like Total = Textbox1 + Textbox2, etc…
Any advice/help is greatly appreciated!
Thanks,
Brian
On the form, users can change the value of the any of the numbers/percentages. I have an onChange as part of the text box that, when the value is changed, the form will submit and write to the database to give the new total.
What I would like to do is have a “real-time” total that displays the added values of all the percentages without having to submit the form. I’m sure this is possible using Javascript but I’m not sure how. Can anyone point me to an example or give me some advice? The number of rows can/do vary so I can’t “hardcode” something like Total = Textbox1 + Textbox2, etc…
Any advice/help is greatly appreciated!
Thanks,
Brian