Ver Mensaje Individual
  #3 (permalink)  
Antiguo 14/08/2007, 09:33
juanstan
 
Fecha de Ingreso: marzo-2007
Mensajes: 31
Antigüedad: 17 años, 1 mes
Puntos: 0
Re: casillas de verificacion

Muchas gracias por tu respuesta,

Una pregunta, que deberia poner en la cabezera del formulario para llamar a la funcion javascript????

Yo he puesto esto

Código HTML:
function checkall() {
   i=1;
   var arraycheck = document.form1["borrar[]"];
        totalcontroles=arraycheck.length;
        if (totalcontroles > 0) 
        if (arraycheck[0].checked==true)
          
            while (i<totalcontroles){
               if (arraycheck[i].disabled == false)
                 arraycheck[i].checked=true;
               else 
                      arraycheck[i].checked=false;              
                 i=i+1;
            } 
        else
              while (i<totalcontroles){
               
                  arraycheck[i].checked=false;
                  i=i+1; 
              }   
	}
//-->
</script> 
y esto en el form:
Código PHP:
<?php
    
    $page_content 
= <<<PAGEOUT
<form id="form1" name="form1" method="post" action="" onsubmit="checkall()">
  <table align="center" cellspacing="0" cellpadding="0" border="2">
      <tr>
        <td id="headerTable" colspan="3"><p class="headerForm">Find the nearest CFA Approved Distributor to:</p>
        <p class="headerForm2">POSTCODE <input type="text" name="postcode" size="6" />
        OR TOWN <input type="text" name="town" /></p>
        (Please enter first digits only e.g. LE15 or SW1)</td>
    </tr>
    <tr><td class="bodyForm">I am looking for fixings from</td><td align="center"><strong>ANY MEMBER</strong></td><td><input name="borrar[0]" id="borrar[]" type="checkbox"/></td></tr>
    <tr><td rowspan="5" valign="top" class="bodyForm">or from</td><td align="center"><img src="supplier1.png" height="25px" width="100px"/></td><td><input name="borrar[1]" id="borrar[]" type="checkbox" /></td></tr>
    <tr><td align="center"><img src="supplier2.png" height="25px" width="100px"/></td><td><input name="borrar[2]" id="borrar[]" type="checkbox"/></td></tr>
    <tr><td align="center"><img src="supplier3.png" height="25px" width="100px"/></td><td><input name="borrar[3]" id="borrar[]" type="checkbox" /></td></tr>
    <tr><td align="center"><img src="supplier4.png" height="25px" width="100px"/></td><td><input name="borrar[4]" id="borrar[]" type="checkbox"/></td></tr>
    <tr><td align="center"><img src="supplier5.png" height="25px" width="100px"/></td><td><input name="borrar[5]" id="borrar[]" type="checkbox"/></td></tr>
    <tr><td colspan="3" align="center"><input type="submit" name="Submit" value="Enviar" class="botonReg" /></td>
</table>
</form>
PAGEOUT;
?>
pero no me funciona, seguramente este haciendo algo mal,
me lo puedes decir?????,

Gracias de nuevo

Última edición por juanstan; 14/08/2007 a las 09:39