Ver Mensaje Individual
  #2 (permalink)  
Antiguo 21/06/2011, 06:47
Avatar de Naahuel
Naahuel
 
Fecha de Ingreso: marzo-2011
Ubicación: localhost
Mensajes: 796
Antigüedad: 14 años
Puntos: 192
Respuesta: Ocultar un select y mostrar otro al pusar radio

Ejemplo:

Código HTML:
Ver original
  1.   function  mostrar_select1(){
  2.    
  3.     document.getElementsByName('select2')[0].style.display = 'none';
  4.     document.getElementsByName('select1')[0].style.display = 'block';
  5.   }
  6.     function  mostrar_select2(){
  7.     document.getElementsByName('select1')[0].style.display = 'none';
  8.     document.getElementsByName('select2')[0].style.display = 'block';
  9.   }
  10.  
  11. <table width="44%" border="1">
  12.  
  13. <tr>
  14. <td width="40%" class="parrafo"><div align="left"><strong>Posee SubNivel:</strong></div></td>
  15. <td width="60%" class="parrafo">&nbsp;&nbsp;Si
  16. <input type="radio" name="radio" id="radio" value="radio"  onClick="mostrar_select1()">
  17. &nbsp;&nbsp;No
  18. <input type="radio" name="radio" id="radio2" value="radio" onClick="mostrar_select2()"></td>
  19. </tr>
  20. <tr id="link1">
  21. <td class="parrafo">&nbsp;</td>
  22. <td class="parrafo">
  23.   <select name="select1" id="select1" style="display:none;">
  24. <option>dato1</option>
  25. <option>datos1</option>
  26.  
  27.   <select name="select2" id="select2" style="display:none;">
  28. <option>otras opciones 1</option>
  29. <option>otras opciones 2</option>
  30. </td>
  31. </tr>
  32.  

Lo único que hice fue modificar un poco tu código, pero no te recomiendo usar Javascript o CSS incrustados. Se hace dificil de seguir y mantener.
__________________
nahueljose.com.ar