kathycam
06-13-2012, 11:23 PM
http://enviroflexsurfaces.com/wp-content/themes/ecobiz/sample.png
I have created a dynamic table (see attached).
I have set the name of each column to an array.
The last column called "TOT" is what I need to work with:
<td><input type="text" name="TOT[]" size="3" maxlength="6"></td>
When you click the "AA" hyperlink, I need the Sub Total input textbox to be set with the total of all values in the TOT array. Right now I can't even get it to display anything at all, much less total.
Here is my javascript:
<script type="text/javascript">
function CalculateSubTotal(TOT)
{
for(var i=0;i<TOT.length;i++)
{
alert(TOT[i]);
}
}
</script>
Here is the href where I call this function:
<a href="javascript:CalculateSubTotal(TOT);">AA</a>
Thanks.
I have created a dynamic table (see attached).
I have set the name of each column to an array.
The last column called "TOT" is what I need to work with:
<td><input type="text" name="TOT[]" size="3" maxlength="6"></td>
When you click the "AA" hyperlink, I need the Sub Total input textbox to be set with the total of all values in the TOT array. Right now I can't even get it to display anything at all, much less total.
Here is my javascript:
<script type="text/javascript">
function CalculateSubTotal(TOT)
{
for(var i=0;i<TOT.length;i++)
{
alert(TOT[i]);
}
}
</script>
Here is the href where I call this function:
<a href="javascript:CalculateSubTotal(TOT);">AA</a>
Thanks.