Ver Mensaje Individual
  #1 (permalink)  
Antiguo 22/11/2011, 02:59
davidmrtnz413
 
Fecha de Ingreso: marzo-2011
Ubicación: Victoria,Mexico
Mensajes: 45
Antigüedad: 13 años, 1 mes
Puntos: 0
Problema con checkbox o formulario doble

Hola que tal tengo la siguiente estrucutra de mi pagina

Código PHP:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Documento sin título</title>
  6. <script type="text/javascript" src="dias.js"></script>
  7. </head>
  8.  
  9. <body>
  10.  
  11. <form action="../../../bacex.php" method="post" id="search">
  12.           <div class="field-holder">
  13.             <input name="busca" type="text" class="field" title="Search" />
  14.           </div>
  15.           <input type="submit" class="button" value="Search" />
  16.           <div class="cl">&nbsp;</div>
  17.       </form>
  18.  
  19.  
  20. <form name="form2" action="enviadias.php" method="post">
  21.  <div><br/>
  22. </div>
  23. </p>
  24.  <p>&nbsp; </p>
  25.  <div align="center">
  26.    <table width="794" border="0">
  27.      <tr>
  28.        <th width="143" rowspan="5">&nbsp;</th>
  29.        <th width="153">&nbsp;</th>
  30.        <td colspan="8">&nbsp;</td>
  31.      </tr>
  32.      <tr>
  33.        <th>&nbsp;</th>
  34.        <td colspan="8">&nbsp;</td>
  35.      </tr>
  36.      <tr>
  37.        <th>&nbsp;</th>
  38.        <td width="30">&nbsp;</td>
  39.        <td width="91">&nbsp;</td>
  40.        <td width="75">&nbsp;</td>
  41.        <td colspan="5">&nbsp;</td>
  42.      </tr>
  43.      <tr>
  44.        <th>Dias:</th>
  45.        <td><div align="left">L
  46.            <input name="dia1" type="checkbox" id="dia1" value="Lunes" />
  47.        </div>
  48.          <label for="dia8"></label></td>
  49.        <td><div align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;M
  50.            <input name="dia2" type="checkbox" id="dia2" value="Martes" />
  51.        </div>
  52.          <label for="dia9"></label></td>
  53.        <td><div align="left">M
  54.            <input name="dia3" type="checkbox" id="dia3" value="Miercoles" />
  55.        </div>
  56.          <label for="dia10"></label></td>
  57.        <td width="67"><div align="left">J
  58.            <input name="dia4" type="checkbox" id="dia4" value="Jueves" />
  59.        </div></td>
  60.        <td width="54"><div align="left">V
  61.            <input name="dia5" type="checkbox" id="dia5" value="Viernes" />
  62.        </div></td>
  63.        <td width="52"><div align="left">S
  64.            <input name="dia6" type="checkbox" id="dia6" value="Sabado" />
  65.        </div></td>
  66.        <td width="44"><div align="left">D
  67.            <input name="dia7" type="checkbox" id="dia7" value="Domingo" />
  68.        </div></td>
  69.        <td width="43">L-V        
  70.          <div>
  71.            <input onclick="ChequearAlgunos2(this);" type="checkbox" />
  72.         </div></td>
  73.      </tr>
  74.      <tr>
  75.        <th>&nbsp;</th>
  76.        <td colspan="8">&nbsp;</td>
  77.      </tr>
  78.    </table>
  79.    <table width="2" border="0">
  80.    </table>
  81.    <p>&nbsp;</p>
  82.    <p>&nbsp;</p>
  83.    <p>
  84.      <input type="submit" name="button2" id="button2" value="Enviar" onclick="this.disabled=true; this.value='Enviando...'; this.form.submit()" />
  85.    </p>
  86.  </div>
  87. <p>&nbsp;</p>
  88. </form>
  89.  
  90. </body>
  91. </html>

esa pagina selecciona 5 de 7 idas a la semana al presionar el ultimo checkbox

y tengo un problema cuando meti esa caja de busqueda, la cual como es otro formulario como que bloquea el otro o algo asi y ya no me deja seleccionar los dias automaticamente

CODIGO JAVASCRIPT PARA SELECCION DE 5 DE 7

Código Javascript:
Ver original
  1. function ChequearAlgunos2(chkbox)
  2.  {
  3.  for (var i=0;i < document.forms["form2"].elements.length;i++)
  4.  {
  5.  var elemento = document.forms[0].elements[i];
  6.  
  7.  if (elemento.id == "dia1")
  8.  {
  9.  elemento.checked = chkbox.checked
  10.  }
  11.   if (elemento.id == "dia2")
  12.  {
  13.  elemento.checked = chkbox.checked
  14.  }
  15.   if (elemento.id == "dia3")
  16.  {
  17.  elemento.checked = chkbox.checked
  18.  }
  19.   if (elemento.id == "dia4")
  20.  {
  21.  elemento.checked = chkbox.checked
  22.  }
  23.   if (elemento.id == "dia5")
  24.  {
  25.  elemento.checked = chkbox.checked
  26.  }
  27.  
  28.   }
  29.  
  30.  }

que podria ser
__________________
¿La mejor respuesa?...Una pregunta