Ver Mensaje Individual
  #2 (permalink)  
Antiguo 11/08/2009, 14:53
Avatar de buzu
buzu
 
Fecha de Ingreso: octubre-2006
Ubicación: San Francisco, CA
Mensajes: 2.168
Antigüedad: 18 años, 4 meses
Puntos: 122
Respuesta: Status inicial deseado...

he hecho esto de rapidito, a ver si te sirve de algo:

Código javascript:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2.         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="es" lang="es">
  4. <head>
  5.     <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6.     <title>Untitled</title>
  7.     <script type="text/javascript">
  8.         window.onload = function(){
  9.             var radio = document.getElementById('radioB');
  10.             var campo = document.getElementById('campo');
  11.             if(campo.value == ''){
  12.                 campo.disabled = 'disabled';
  13.             }
  14.            
  15.             radio.onclick = function(){
  16.                 campo.disabled = campo.disabled = 'disabled' ? '' : 'disabled';
  17.             }
  18.         }
  19.     </script>
  20. </head>
  21. <body>
  22. <form>
  23.     <input type="text" id="campo" name="campo" value = 'b' />
  24.     <input name="radioB" id="radioB" type="radio" value="radioB" />RadioB
  25. </form>
  26. </body>
  27. </html>
__________________
twitter: @imbuzu