Código javascript:
me muestra todos menos los checkbox, mi formulario:Ver original
for (i=0;i<$(f1).elements.length;i++){ alert($(f1).elements[i].type) }
Código:
estoy usando prototype para completar la info <form action="#" method="post" name="fusers_edit" id="fusers_edit" > <input name="nombre_u" type="text" id="nombre_u" size="86" class="campo_1" title="Introduce tu nombre completo. Ejemplo: Antonio " value="<?php echo htmlentities($user->nom_asesor);?>" /> </label></td> </tr> <tr> <td width="180"><span class="texto">Apellidos del usuario:</span></td> <td width="558"><label> <input name="apellidos_u" type="text" id="apellidos_u" size="86" class="campo_1" title="Introduce tu nombre completo. Ejemplo: Rueda Treviño" value="<?php echo htmlentities($user->apel_asesor);?>"/> </label></td> </tr> <tr> <td><span class="texto">Login del usuario:</span></td> <td><label> <input name="login_u" type="text" id="login_u" size="86" class="campo_1" title="Introduce el nombre de usuario." value="<?php echo $user->userName;?>"/> </label></td> </tr> <tr> <td><span class="texto">Contraseña:</span></td> <td><label> <input name="pass_u" type="password" id="pass_u" size="86" class="campo_1" title="Introduce la contraseña." value="<?php echo $user->userPass;?>"/> </label></td> </tr> <tr> <td><span class="texto">Confirmar Contraseña:</span></td> <td><label> <input name="cpass_u" type="password" id="cpass_u" size="86" class="campo_1" title="Introduce la contraseña de nuevo para confirmarla." value="<?php echo $user->userPass;?>"/> </label></td> </tr> <tr> <td><span class="texto">Cargo:</span></td> <td><label> <script language="javascript">setInputValue($("cargo_u"),"<?php echo $user->cargo; ?>");</script> <select id="cargo_u" name="cargo_u" class="campo_1" style="width:542px;"> <option value="none"></option> <option value="DIRECTOR">Director</option> <option value="DIRECTORA">Directora</option> <option value="ASESOR">Asesor</option> <option value="ASESORA">Asesora</option> </select> </label></td> </tr> <tr> <td><span class="texto">Asesoría:</span></td> <td><label> <script language="javascript">setInputValue($("asesoria_u"),"<?php echo $user->asesoria; ?>");</script> <select id="asesoria_u" name="asesoria_u" class="campo_1" style="width:542px;"> <option value="none"></option> <option value="SIN ASESORÍA">Sin Asesoria</option> <option value="INFANTIL">Infantil</option> <option value="PRIMARIA">Primaria</option> <option value="SECUNDARIA">Secundaria</option> <option value="FORMACIÓN PROFESIONAL">Formacion Profesional</option> <option value="ATENCIÓN A LA DIVERSIDAD">Atencion a la Diversidad</option> </select> </label></td> </tr> <tr> <td><span class="texto">Correo Electrónico:</span></td> <td><label> <input name="correo_u" type="text" id="correo_u" size="86" class="campo_1" title="Introduce el correo." value="<?php echo $user->userMail;?>"/> </label></td> </tr> </table> </div> <input checked="checked" type="checkbox" name="todas" id="todas" <?php echo $this->marcar_privilegios($this->privilegios[1]);?> /> </label></td> <td width="180">Todas las priodidades</td> <td width="20"><label> <input checked="checked" type="checkbox" name="ggtt" id="ggtt" <?php echo $this->marcar_privilegios($this->privilegios[5]);?>/> </label></td> <td width="180">Grupos de Trabajo</td> <td width="20"><label> <input checked="checked" type="checkbox" name="imagenes" id="imagenes" <?php echo $this->marcar_privilegios($this->privilegios[7]);?>/> </label></td> <td width="180">Galería de imágenes</td> <td width="20"> </td> <td width="95"> </td> </tr> <tr> <td><label> <input checked="checked" type="checkbox" name="ninguna" id="ninguna" <?php echo $this->marcar_privilegios($this->privilegios[2]);?>/> </label></td> <td>Ninguna prioridad</td> <td><label> <input checked="checked" type="checkbox" name="af" id="af" <?php echo $this->marcar_privilegios($this->privilegios[6]);?>/> </label></td> <td>Acciones Formativas</td> <td><label> <input checked="checked" type="checkbox" name="videos" id="videos" <?php echo $this->marcar_privilegios($this->privilegios[8]);?> /> </label></td> <td>Galería de Videos</td> <td> </td> <td> </td> </tr> <tr> <td><label> <input checked="checked" type="checkbox" name="general" id="general" <?php echo $this->marcar_privilegios($this->privilegios[3]);?>/> </label></td> <td>General</td> <td><label> <input checked="checked" type="checkbox" name="calendario" id="calendario" /> </label></td> <td>Calendario</td> <td><label> <input checked="checked" type="checkbox" name="videos" id="videos" <?php echo $this->marcar_privilegios($this->privilegios[9]);?> /> </label></td> <td>Noticias</td> <td> </td> <td> </td> </tr> <tr> <td><label> <input checked="checked" type="checkbox" name="usuarios" id="usuarios" <?php echo $this->marcar_privilegios($this->privilegios[4]);?>/> </label></td> <td>Usuarios</td> <td><label> <input checked="checked" type="checkbox" name="novedades" id="novedades" /> </label></td> <td>Novedades</td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> </form>