Mam takie coś:
<html>
<head>
<script language="JavaScript" type="text/javascript">
<!--
function checkUncheckAll(theElement) {
var theForm = theElement.form, z = 0;
while (theForm[z].type == 'checkbox' && theForm[z].name != 'checkall') {
theForm[z].checked = theElement.checked;
z++;
}
}
// -->
</script>
</head>
<body>
<form method=post>
<input type="submit" value="Dodaj zaznaczone">
cos tam
<input type="checkbox" name="dow" value="1" id="dow1"><label for="dow1">Zaznacz</label><br>
jakis tekst
<input type="checkbox" name="dow" value="2" id="dow2"><label for="dow2">Zaznacz</label><br>
<input type="checkbox" name="checkall" onclick="checkUncheckAll(this)" id="sel"><label for="sel">Zaznacz/odznacz wszystko</label>
</form>
</body>
</html>
Nie działa w tym "Zaznacz/odznacz wszystko"
Jednak po wywaleniu przycisku z submitem działa
Co jest nie tak?