Pero resulta que no sé utilizarlos y no encuentro ejemplos que entienda o que me puedan servir.
Mi tabla usuarios tiene los campos de las opciones que tengo como user_comics, user_conciertos etc en el cual su valor va a ser boolean Si/No.
Los he incluido en el formulario de esta manera:
Código:
Pero no sé cómo hacer que en la página a la que va, pueda recoger si se ha marcado o no el campo. Podriais ayudarme?<input type="checkbox" name="chkcomics" value="Si"> Comics
Copio por si puede servir el código.
Código:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Alta de Usuario</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <script language="javascript"> function comprobar() { campos='' if (formalta.txtnick.value=='') campos=campos+"\n\n * Nick" if (formalta.txtnombre.value=='') campos=campos+"\n\n * Nombre" if (formalta.txtmail.value==''){ campos=campos+"\n\n * Correo electrónico" }else{ if((formalta.txtmail.value.indexOf ('@', 0) == -1)||(formalta.txtmail.length < 5)){ campos=campos+"\n \n* Correo electrónico (no valido)" } } if (formalta.txtpass.value=='') campos=campos+"\n\n * Contraseña" if (campos==''){ //enviar formalta.submit() }else{ // Se envía a la función campos, los campos que se necesitan if (campos!='') {peticion(campos)} } } // En la variable campos están los campos requeridos function peticion(campos) { alert("Debe rellenar los siguientes campos: "+campos) } </script> <tr valign="top"> <td><form name="formalta" id="formalta" method="post" action="guardarusuario.asp"> <table width="502" height="159" border="0" align="center" cellpadding="0" cellspacing="0" class="tb_form"> <tr valign="top"> <td width="90"><strong>Nick</strong></td> <td width="380"> <input name="txtnick" type="text" id="txtnick2" size="30" /></td> </tr> <tr valign="top"> </tr> <tr valign="top"> <td><strong>Contraseña</strong></td> <td><input name="txtpass" type="password" id="txtpass2" size="30" /></td> </tr> <tr valign="top"> <td width="90"><strong>Nombre</strong></td> <td width="380"> <input name="txtnombre" type="text" id="txtnombre2" size="30" /></td> </tr> <tr valign="top"> <td width="90"><strong>Correo Electronico</strong></td> <td width="380"> <p> <input name="txtmail" type="text" id="txtmail2" size="30" /> </p> <tr valign="top"> <td width="90"><strong>Intereses</strong></td> <td width="380"> <p>Deseo recibir información sobre:</p> <p> <input type="checkbox" name="chkcomics" value="Si"> Comics <input type="checkbox" name="chkconciertos" value="Si"> Conciertos <input type="checkbox" name="chkdiscos" value="Si"> Discos <input type="checkbox" name="chkgrupos" value="Si"> Grupos <p> <input type="checkbox" name="chkrestaurantes" value="Si"> Restaurantes <input type="checkbox" name="chkjuegos" value="Si"> Juegos <input type="checkbox" name="chkarte" value="Si"> Arte <input type="checkbox" name="chkcine" value="Si"> Cine </td> </tr> <tr valign="top"> <td> </td> <td> </td> </tr> </table> <p> </p> <p> <input type="reset" name="Reset" value="Borrar"> <input name="cmdenviar" type="button" onClick="comprobar()" value="Enviar"> </p> <p> </p> </table></form> </table> </table> </body> </html>