Ver Mensaje Individual
  #5 (permalink)  
Antiguo 01/06/2010, 12:52
Avatar de Adler
Adler
Colaborador
 
Fecha de Ingreso: diciembre-2006
Mensajes: 4.671
Antigüedad: 17 años, 3 meses
Puntos: 126
Respuesta: AJAX y Multiple CheckBOX

Hola

Prueba ahora. Fíjate como ha de quedar arreglo a los cambios que hicistes

Código Javascript:
Ver original
  1. <html>
  2. <head>
  3. <script type="text/javascript">
  4. function valores() {
  5.     cual = 't[]';
  6.     f= document.formA;
  7.  todos = new Array();
  8.  for (var i = 0, total = f[cual].length; i < total; i++)
  9.    if (f[cual][i].checked) todos[todos.length] = f[cual][i].value;
  10.    return todos.join("&");
  11. }
  12. </script>
  13. </head>
  14. <body >
  15.     <form name="formA" id="formA" >
  16.         <input name="t[]" id="t[]" type="checkbox" value="0000" />
  17.         <input name="t[]" id="t[]" type="checkbox" value="1111" />
  18.         <input name="t[]" id="t[]" type="checkbox" value="2222" />
  19.         <input name="t[]" id="t[]" type="checkbox" value="3333" />
  20.         <input name="t[]" id="t[]" type="checkbox" value="4444" />
  21.         <input name="t[]" id="t[]" type="checkbox" value="5555" />
  22.         <button onclick="alert(valores())" >mostrar</button>
  23.     </form>
  24. </body>
  25. </html>

Suerte
__________________
Los formularios se envían/validan con un botón Submit
<input type="submit" value="Enviar" style="background-color:#0B5795; font:bold 10px verdana; color:#FFF;" />