Ver Mensaje Individual
  #2 (permalink)  
Antiguo 04/04/2012, 09:59
chicoxml
 
Fecha de Ingreso: marzo-2011
Mensajes: 13
Antigüedad: 13 años, 1 mes
Puntos: 0
Respuesta: aparecer boton dependiendo de la eleccion

Código Javascript:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Untitled Document</title>
  6.  
  7. <script>
  8.  
  9.  
  10. function verificar_eleccion(obj){
  11.     if(obj.id =='eleccion_1'){
  12.             document.getElementById("dinero").style.display='block';
  13.     }else{
  14.                     document.getElementById("dinero").style.display='none';    
  15.     }
  16. }
  17.  
  18. </script>
  19. </head>
  20.  
  21.  
  22. <body>
  23. <p>
  24.   <label>
  25.     <input type="radio" name="eleccion" value="gratis" id="eleccion_0" onchange="verificar_eleccion(this)" />
  26.     Gratis</label>
  27.   <br />
  28.   <label>
  29.     <input type="radio" name="eleccion" value="pagar" id="eleccion_1"  onchange="verificar_eleccion(this)" />
  30.     Pagar</label>
  31.   <br />
  32.   <input type="text" name="dinero" id="dinero" style="display:none" />
  33. </p>
  34. </body>
  35. </html>