Ver Mensaje Individual
  #5 (permalink)  
Antiguo 08/06/2010, 11:04
Avatar de _cronos2
_cronos2
Colaborador
 
Fecha de Ingreso: junio-2010
Mensajes: 2.062
Antigüedad: 13 años, 10 meses
Puntos: 310
Respuesta: Checkbox en formulario....

Vale, perdón, esque lo escribí sin fijarme. Esto sí funciona poruqe lo comprobé.

Código Javascript:
Ver original
  1. <script type="text/javascript">
  2. function texto(a,b){
  3.  if(document.getElementById(a).checked==true){
  4.   document.getElementById(b).style.display = 'block';
  5.  }else{
  6.   document.getElementById(b).style.display = 'none';
  7.  }
  8. }
  9. </script>

Código HTML:
Ver original
  1. <input type='checkbox' id='chk' onclick='texto(this.id, "caja");' /><!--->Ni tenía id ni había puesto this.id -.-'<!--->
  2. <input type='text' id='caja' style='display:none;' />

Saludos y perdón (: