attach a javascript hander to the onblur event of each textbox. is this
handler add up the textbox values, and display in whatever you are displaying
in:
sample:
// add textbox in InputPanel and put total in last
var panel = document.getElementById('<%= inputPanel.ClientID%>');
var list = panel.getElementsByTagName('input');
var textboxList = [];
for (var i=0; i < list.length - 1; ++i)
{
if (list[i].type.toLowerCase() == 'text')
{
textboxList.push(list[i]);
list[i].onblur = doBlur;
}
}
function doBlur(e) {
var total = 0;
for (var i=0; i < textboxList.length - 1; ++i)
{
total += parseFloat(textboxList[i].value);
}
textboxList[textboxList.length-1].value = total;
}
-- bruce (sqlwork.com)
"Paul" wrote:
Hi I have a webform with several entry boxes and the user enters numbers in
each box. I keep a running total (just adds all of the entries together) but
am posting back to the server to do this. Is there any way to do it all on
the client side, without posting back to the server? I would like to update
the running total each time the user inputs an amount in a textbox and then
goes to the next textbox.
Thanks,
--
Paul G
Software engineer.