Tema: Checkbox
Ver Mensaje Individual
  #3 (permalink)  
Antiguo 06/04/2009, 05:37
quimfv
Colaborador
 
Fecha de Ingreso: marzo-2008
Ubicación: Sabadell
Mensajes: 4.897
Antigüedad: 16 años, 10 meses
Puntos: 574
Respuesta: Checkbox

Código html:
Ver original
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <title>Documento sin t&iacute;tulo</title>
  3. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  4. <script language="JavaScript" type="text/JavaScript">
  5. function marcals_tots(){
  6.  if (document.form1.tots.checked){
  7.          document.form1.d1.checked=true;
  8.          document.form1.d2.checked=true;
  9.          document.form1.d3.checked=true;
  10.  }else{
  11.          document.form1.d1.checked=false;
  12.          document.form1.d2.checked=false;
  13.          document.form1.d3.checked=false;
  14.  }
  15. }
  16. </head>
  17. <body><form name="form1" method="post" action="">
  18. <table width="474" border="1" cellspacing="0" cellpadding="0">
  19.   <tr>
  20.     <td>
  21.       En caso de ser <b><u>TODOS</u></b> marca aquí</td>
  22.     <td><input name="tots" type="checkbox" id="tots" value="checkbox" onChange="marcals_tots()"></td>
  23.   </tr>
  24.   <tr>
  25.     <td>D1</td>
  26.     <td><input name="d1" type="checkbox" id="d1" value="checkbox"></td>
  27.   </tr>
  28.   <tr>
  29.     <td>D2</td>
  30.     <td><input name="d2" type="checkbox" id="d2" value="checkbox"></td>
  31.   </tr>
  32.   <tr>
  33.     <td>D3</td>
  34.     <td><input name="d3" type="checkbox" id="d3" value="checkbox"></td>
  35.   </tr>
  36.  </form>
  37. </body>
  38. </html>

así se parece mas a lo que intentabas....

Quim