Tema: crazy buttom
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 05/03/2003, 14:40
Avatar de tunait
tunait
Moderadora
 
Fecha de Ingreso: agosto-2001
Ubicación: Terok Nor
Mensajes: 16.805
Antigüedad: 22 años, 8 meses
Puntos: 381
Hola tarlipes,

mira a ver si así te sirve:

<script language="javascript">
var cont=0
function boton(cual,donde)
{
if(cual.checked==true){cont++}
else{cont--}
if(cont>0)
{donde.enviar.style.visibility='visible'}
else{
donde.enviar.style.visibility='hidden'}

}
</script>

Y luego a cada checkbox le pones lo mismo

onClick="boton(this,this.form)"

<input type="checkbox" name="checkbox" value="checkbox" onClick="boton(this,this.form)">
<input type="checkbox" name="checkbox2" value="checkbox" onClick="boton(this,this.form)">
<input type="checkbox" name="checkbox3" value="checkbox" onClick="boton(this,this.form)">
<input type="checkbox" name="checkbox4" value="checkbox" onClick="boton(this,this.form)">

y a tu botón de envio

<input type="submit" name="enviar" value="Enviar" style="visibility:hidden">

El botón aparece cuando haya al menos un campo. Si una vez se muestra el botón se desactivan todos los campos, al des-seleccionar el último el botoncillo se oculta de niu.