Ver Mensaje Individual
  #4 (permalink)  
Antiguo 14/03/2012, 19:30
tesistas
 
Fecha de Ingreso: septiembre-2010
Mensajes: 74
Antigüedad: 13 años, 7 meses
Puntos: 1
Respuesta: quiero habilitar textbox al tildar checkbox

Cita:
Iniciado por xxxivanxxx Ver Mensaje
como bien dise neglivv tienes que usar JS, con el evento onChange se hace un poco facil mira:

Código HTML:
Ver original
  1. <input type="checkbox" id="chk" onChange="validarchk();" />
  2. <input type="text" disabled="disabled" id="txt" />
  3. </form>
  4.  
  5.  
  6.  
  7. function validarchk(){
  8. var chk = document.getElementById('chk');
  9. var txt = document.getElementById('txt');
  10. if(chk.checked){
  11.     txt.disabled='';
  12. }else{
  13.     txt.value='';
  14.     txt.disabled='disabled';
  15. }
  16. }
desde ya muchas gracias por tu respuesta xxxivanxxx y a ti tambien neglivv, el problema es que la pagiina esta en php, no en html. Y creo que no se puede integrar java en php. por lo que no podria aplicar la solucion que me brindaron