Javascript.
First, you'll need to add the ID tag to your input boxes with the same value
as the name, and do something with the name and id that makes them
identifiable, as a box you want to sum like naming them
name="schedBox<%=scheduled_amount_row%>". You could also assign them a
specific CSS class (i.e. class="SUMBOX") and then search on their style
property, or you could just assume that all textboxes should be summed.
Then, you can put something like the following into your web page:
<SCRIPT language="javascript">
function CheckSum()
{
var oTextBoxes=document.getElementsByTagName("input");
var oTextBox;
var total;
for (i=0; i < oTextBoxes.length; i++)
{
oTextBox=oTextBoxes[i];
if (oTextBox.name.search("schedBox") != -1)
{
total+=oTextBox.value;
}
}
//Do something with the total
}
</SCRIPT>
Robert
"JT" <je******@sppinc.net> wrote in message
news:%2***************@tk2msftngp13.phx.gbl...
but that would give me a sum based on what is returned from the db - i
need this for client side validation so i need to get the amount that the user
typed in, not the amount retrieved.
any other thoughts???
"Adrienne" <ar****@sbcglobal.net> wrote in message
news:Xn****************************@207.115.63.158 ... Gazing into my crystal ball I observed "JT" <je******@sppinc.net>
writing in news:uj**************@tk2msftngp13.phx.gbl:
ok - here is my problem:
i have a page that dynamically displays payment info for accounts.
since each account differs in the number of rows to display, i loop
through my recordset and use the following asp embedded html:
<input type="text" style="TEXT-ALIGN: right"
value="<%=formatnumber(rsOldPaymentInfo.Fields("sc heduled_amount"),2)%>" name="<%=scheduled_amount_row%>" align="right" style="FONT-SIZE:
xx-small; width=50px">
i need to get a sum of these amounts and i am doing this for
validation so i need the values that are posted to the page, not the values
retrieved from the recordset.
so i know that i need to declare a variable that will record a tally
of the amounts posted: something like:
mySum = mySum + Response.Write("<input type="text" style="TEXT-ALIGN:
right"
value="<%=formatnumber(rsOldPaymentInfo.Fields("sc heduled_amount"),2)%>" name="<%=scheduled_amount_row%>" align="right" style="FONT-SIZE:
xx-small; width=50px">")
--but i don't know how to get this tally correctly
any thoughts???
tia
jt
mysum = mysum + rsOldPaymentInfo.Fields("scheduled_amount")
--
Adrienne Boswell
Please respond to the group so others can share
http://www.arbpen.com