Hola
A ver si es esto lo que quieres, por que con lo de
array superglobales me has mataó
Código Javascript
:
Ver original<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
<script type="text/javascript">
dias = new Array(1,3,5,7,9);
window.onload = function() {
for(i=0; i < dias.length; i++) {
document.getElementById('dia'+dias[i]).checked = true;
}
}
</script>
</head>
<body>
<input type="checkbox" id="dia1" value="" /><br />
<input type="checkbox" id="dia2" value="" /><br />
<input type="checkbox" id="dia3" value="" /><br />
<input type="checkbox" id="dia4" value="" /><br />
<input type="checkbox" id="dia5" value="" /><br />
<input type="checkbox" id="dia6" value="" /><br />
<input type="checkbox" id="dia7" value="" /><br />
<input type="checkbox" id="dia8" value="" /><br />
<input type="checkbox" id="dia9" value="" /><br />
<input type="checkbox" id="dia10" value="" />
</body>
</html>
Suerte