Ver Mensaje Individual
  #4 (permalink)  
Antiguo 17/06/2011, 16:06
Avatar de Naahuel
Naahuel
 
Fecha de Ingreso: marzo-2011
Ubicación: localhost
Mensajes: 796
Antigüedad: 13 años, 1 mes
Puntos: 192
Respuesta: opcion cambio

Y no varía demasiado. Acá usarías "onclick" para cada radiobutton y modificamos un poco la función de acuerdo a los valores:


Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
  2.   <head>
  3.     <script type="text/javascript">
  4. function cambiar_opcion(combo){
  5.     if(combo.value=='solo texto'){
  6.      document.getElementById('imagen').style.display = 'none';}
  7.     else if(combo.value=='con imagen'){
  8.      document.getElementById('imagen').style.display = 'block';
  9.     }
  10.     }
  11.     </script>
  12.     <title></title>
  13.   </head>
  14.   <body>
  15.     <p>
  16.        <input type="radio" name="opcion" onclick="cambiar_opcion(this)" value="solo texto" id="opcion_0" />
  17.       <input type="radio" name="opcion" onclick="cambiar_opcion(this)" value="con imagen" id="opcion_1" />
  18.     </p>
  19.     <p>
  20.       <textarea cols="6" rows="6">
  21. </textarea> <input style="display:none;" id="imagen" name="imagen" type="file">
  22.     </p>
  23.   </body>
  24. </html>
__________________
nahueljose.com.ar