Ver Mensaje Individual
  #2 (permalink)  
Antiguo 12/01/2011, 13:10
Avatar de _cronos2
_cronos2
Colaborador
 
Fecha de Ingreso: junio-2010
Mensajes: 2.062
Antigüedad: 13 años, 10 meses
Puntos: 310
Respuesta: Función javascript con arreglo de checkbox

Código Javascript:
Ver original
  1. function habil(obj){
  2.  document.getElementById(obj.id.replace('chk','select')).disabled=!obj.checked;
  3. }
Código HTML:
Ver original
  1. <input type="checkbox" id="chk1" name="chk1" onchange="habil(this);" value="1" />
  2. <select id="select1" name="select1" disabled>
  3. <option value="value1">option 1</option>
  4. <option value="value2">option 2</option>
  5. <option value="value3">option 4</option>
Saludos (:
__________________
" Getting older’s not been on my plans
but it’s never late, it’s never late enough for me to stay. "
Cigarettes - Russian Red