S
Sems
Hi
I have a table that contains two columns. Each column has a textbox in
it. I need to sum up the numbers entered into the textboxes. This has
to be done client side using javascript, the rest of the application
is an asp .net application.
I have a javascript function that loops through the table but I still
can't get at the values in the textboxes. Here is my function...
<script language="jscript" type="text/jscript">
function tableSpin() {
var yourTable = document.all("gdSeries");
var yourTotalControl = document.all("totalDiv")
for (var i = 0; i < yourTable.rows.length - 1; i++) {
if (!isNaN(yourTable.rows.cells[1].innerText) &&
yourTable.rows.cells[1].innerText != "")
{
if (!isNaN(yourTable.rows.cells[1].innerText))
alert(yourTable.rows.cells[1].innerHTML);
}
}
}
</script>
I've got an alert in the last if statement at the moment but what I
really want to do is get the value in the textbox in the cell. How do
I do this?
The alert shows the HTML for an INPUT control in which I can see the
'value' field that contains the value in the textbox. How can I get to
this value?
Thanks
I have a table that contains two columns. Each column has a textbox in
it. I need to sum up the numbers entered into the textboxes. This has
to be done client side using javascript, the rest of the application
is an asp .net application.
I have a javascript function that loops through the table but I still
can't get at the values in the textboxes. Here is my function...
<script language="jscript" type="text/jscript">
function tableSpin() {
var yourTable = document.all("gdSeries");
var yourTotalControl = document.all("totalDiv")
for (var i = 0; i < yourTable.rows.length - 1; i++) {
if (!isNaN(yourTable.rows.cells[1].innerText) &&
yourTable.rows.cells[1].innerText != "")
{
if (!isNaN(yourTable.rows.cells[1].innerText))
alert(yourTable.rows.cells[1].innerHTML);
}
}
}
</script>
I've got an alert in the last if statement at the moment but what I
really want to do is get the value in the textbox in the cell. How do
I do this?
The alert shows the HTML for an INPUT control in which I can see the
'value' field that contains the value in the textbox. How can I get to
this value?
Thanks