posted 21 years ago
hi Anu
so when exactly you want to have that sum and put in the result text box? you use appropriate event to do this.
as far as javascript code for this might be concerned you can have a sort of following function that returns the addition of all the textfields you want to add,
var fieldsarray = new Array(document.myform.field1, document.myform.field2, document.myform.field3);
function storesumto(destination) {
var temp=0;
for(var i=0; i< fieldsarray.length; i++) {
temp += parseInt(fieldsarray[i].value,10);
}
destination.value = temp;
}
where destination might be document.myform.field4 which you pass to the function from where you are calling it.
hope this helps.
regards
maulin