Matt Ellison
August 10th, 2001, 08:33 AM
I have a web page which is nicely generated through a database query. Basically it's a form that can be changed on any occasion. These forms have text boxes which need to be added up for a total box at the bottom of the page. There are two issues. First i would like to be able to add those elements on the client side (since i'm not actually storing the added total). Secondly the text boxes are named differently to relate to a key in the database for later updating and inserting. I need to be able to auto generate Javascript on the server side to add all the elements on a 'onchange' event. Below is an example of what i mean.
function TOTAL_onchange() {
var temp = 0.00;
temp = Number(document.thisForm.TOTAL.value) +
Number(document.thisForm.TOTAL.value);
document.thisForm.TOTAL.value = temp;
}
the TOTAL variable will be replaced and repeated according to how many elements exist on the page. If you need any clarifiaction please let me know.
Thanks
function TOTAL_onchange() {
var temp = 0.00;
temp = Number(document.thisForm.TOTAL.value) +
Number(document.thisForm.TOTAL.value);
document.thisForm.TOTAL.value = temp;
}
the TOTAL variable will be replaced and repeated according to how many elements exist on the page. If you need any clarifiaction please let me know.
Thanks