Ver Mensaje Individual
  #5 (permalink)  
Antiguo 20/09/2012, 21:01
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: Deshabilitar un control input radio

El planteo me parece algo confuso, por lo pronto los id de los elementos deben ser únicos

Ej:
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <title>titulo</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6.  
  7. <script type="text/javascript">
  8. //<![CDATA[
  9. /* script */
  10. function deshabilitar(){
  11. document.getElementById('c').disabled = true;
  12. }
  13. function habilitar(){
  14. document.getElementById('c').disabled = false;
  15. }
  16. //]]>
  17. </head>
  18. <form action="#">
  19. <label for="a">A</label><input type="radio" id="a" name="grupo" onclick="deshabilitar()"/>
  20. <label for="b">B</label><input type="radio" id="b" name="grupo" onclick="habilitar()"/> <br />
  21. <label for="c">C</label><input type="radio" id="c" name="grupo"/>
  22. </form>
  23. </body>
  24. </html>

Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.