Could this be something?
<html>
<body>
<script language='Javascript'>
<!--
function CountCheck(){
var counter = 0;
var counter_checked = 0;
for(i=0; i < document.forms(0).length; i++){
if (document.forms(0).elements(i).type.indexOf("check box") > -1){
if (document.forms(0).elements(i).checked == true) counter_checked++;
counter++;
}
}
alert("You have " + counter + " checkboxes, " + counter_checked + " are
checked...")
}
//-->
</script>
<form>
<input type="checkboX"><br>
<input type="checkbox"><br>
<input type="checkbox"><br>
<input type=button onClick="CountCheck();" value="Count checkboxes"/>
</form>
</body>
</html>
Cheers
Cristian
"Peter Cresswell" <p-> wrote in message
news:...
> Hi Guys & Gals,
>
> Is it possible to access controls (e.g. a CheckBox) within a template
column
> in a datagrid with JavaScript?
>
> I would like to count the number of rows in my datagrid with checked boxes
> on the client side, i.e. without a post back.
>
> Anybody know how to do this?
> I would also like to do a hotmail style select all on the client side. Is
> this possible with a datagrid?
>
> Thanks in advance!
>
> Peter
>
>
|