This snippet verifies if at least one item of list[] is checked
<?php
var TestCheckbox = document.getElementsByName("list[]");
var IsChecked = 0 ;
for (var x = 0 , y = TestCheckbox.length ; x<y ; x++ ){
if (TestCheckbox[x].checked){
IsChecked = 1;
}
}
if (IsChecked){
alert("checked...");
}else{
alert("not checked...");
}
?>
0 comments:
Post a Comment