Prit
08-28-2003, 10:56 AM
Hi Everyone,
This is my first post to the froum so please overlook any mistakes in my posting.
My Problem: I have an ASP page which has a repeat region. So the number of rows can vary depending on the account being viewed.
There is a javascript function which calculates the running total. This uses the total number of rows. (thanks to Stephen Travis of Thingumajig). Is there a way where I can allot the total number of rows to this variable?
Any help would be nice
thanks in advance
Prit
Here is part of the code:
<script language="JavaScript"><!--
function Total() {
var q, iCount, Grandtotal, total;
iCount = 1;
Grandtotal = 0;
nitems = 2
//This would be the variable something like nitems=<%=count %>
for (iCount=1; iCount<nitems+1; iCount++) {
eval("q = document.orderform.Item" + iCount + "Invelect.value;");
if (q) {
eval("total=parseInt(q);");
eval("Grandtotal = Grandtotal + total;");
}
}
document.orderform.GrandTotal.value = (Grandtotal);
}
//-->
</script>
This is my first post to the froum so please overlook any mistakes in my posting.
My Problem: I have an ASP page which has a repeat region. So the number of rows can vary depending on the account being viewed.
There is a javascript function which calculates the running total. This uses the total number of rows. (thanks to Stephen Travis of Thingumajig). Is there a way where I can allot the total number of rows to this variable?
Any help would be nice
thanks in advance
Prit
Here is part of the code:
<script language="JavaScript"><!--
function Total() {
var q, iCount, Grandtotal, total;
iCount = 1;
Grandtotal = 0;
nitems = 2
//This would be the variable something like nitems=<%=count %>
for (iCount=1; iCount<nitems+1; iCount++) {
eval("q = document.orderform.Item" + iCount + "Invelect.value;");
if (q) {
eval("total=parseInt(q);");
eval("Grandtotal = Grandtotal + total;");
}
}
document.orderform.GrandTotal.value = (Grandtotal);
}
//-->
</script>