Still 'works' here in IE:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
onload = function(){
var c = document.listcases.elements;
for (var i = c.length - 1; i > -1; --i){
if(c[i].id == 'cases[]' && c[i].checked == true){
alert('works');
}
}
}
</script>
</head>
<body>
<form action="#" name="listcases">
<input type="checkbox" id="cases[]" name="cases[]" value="testing1" checked>
<input type="checkbox" id="cases[]" name="cases[]" value="testing2" checked>
</form>
</body>
</html>
Sounds like there might be a problem (in your version) with the undeclared variable 'txtid'. Try changing:
Code:
txtid = zform.elements[i].value.split(':')
to:
Code:
var txtid = zform.elements[i].value.split(':')
And testing1 (the value of the checkbox) when split on ':' will have an index [1] of undefined. So (again, in your version):
Code:
url += txtid[1] + ','
would result in 'undefined,' or some other falsey string being added to the existing value of 'url'. Or it might even cause an error.
But without seeing the page, I can only guess:
Please post a link to a page on your site that contains the problematic code so we can check it out.
Bookmarks