misslois74
Programmer
im working on a page which has a table consisting of checkbox and textbox now what i would like to happen is to be able to get the sum of the values entered on the textboxes per row and per column here is my code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<script type="text/javascript">
function disen(c){
var textBoxes=c.parentNode.parentNode.getElementsByTagName('input'), i=1, t;
while(t=textBoxes[i++]){
if(c.checked){t.removeAttribute('disabled');}
else{t.value='';t.setAttribute('disabled','disabled');}
}
}
</script>
</head>
<body>
<table border=0 cellpadding=1 cellspacing=5>
<tr>
<th>Days of Month</th>
<th>Kids</th>
<th>Adults</th>
<th>Volunteers</th>
</tr>
<?php for($i=1;$i<=31;$i=$i+1)
{
echo '<tr>
<td>'.$i.' <input type="checkbox" onclick="disen(this)"></td>
<td><input type="text" disabled="disabled" size=5 ></td>
<td><input type="text" disabled="disabled" size=5 ></td>
<td><input type="text" disabled="disabled" size=5 ></td>
</tr>';
}
?>
</table>
</body>
</html>
hope you could help me with these....
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<script type="text/javascript">
function disen(c){
var textBoxes=c.parentNode.parentNode.getElementsByTagName('input'), i=1, t;
while(t=textBoxes[i++]){
if(c.checked){t.removeAttribute('disabled');}
else{t.value='';t.setAttribute('disabled','disabled');}
}
}
</script>
</head>
<body>
<table border=0 cellpadding=1 cellspacing=5>
<tr>
<th>Days of Month</th>
<th>Kids</th>
<th>Adults</th>
<th>Volunteers</th>
</tr>
<?php for($i=1;$i<=31;$i=$i+1)
{
echo '<tr>
<td>'.$i.' <input type="checkbox" onclick="disen(this)"></td>
<td><input type="text" disabled="disabled" size=5 ></td>
<td><input type="text" disabled="disabled" size=5 ></td>
<td><input type="text" disabled="disabled" size=5 ></td>
</tr>';
}
?>
</table>
</body>
</html>
hope you could help me with these....