Hola Tengo el siguiente código, funciona perfectamente si cambio a la primera opción, pero lo que deseo es que cada opcion despliegue un campo y oculte otro.
    
Código Javascript
:
Ver original- window.onload = function() { 
-         var eSelect = document.getElementById('transfer_reason'); 
-         var optOtherReason = document.getElementById('otherdetail'); 
-         eSelect.onchange = function() { 
-             if(eSelect.selectedIndex === 1) { 
-                 optOtherReason.style.display = 'block'; 
-             } else { 
-                 optOtherReason.style.display = 'none'; 
-             } 
-         } 
-     } 
Código HTML:
Ver original- <select name="nofarmaco_prev" id="transfer_reason2" style="width:100%;float:left;margin-right:10px; " onchange="document.getElementById('otherdetail2').style.display = (this.selectedIndex === 1) ? 'block' : 'none';"> 
-   
- <div id="otherdetail2" style="display: none;"> 
-     <table class="nuevo_paciente" width="100%"> 
- <h2>- ¿Tipo de tratamiento? </h2>
 
-          
-             <select name="farmaco_prev" id="transfer_reason2" style="width:100%;float:left;margin-right:10px; " > 
-                 <option value="2">- Ambas Farmacológico/No Farmacológico </option>
 
-   
-      
Espero su ayuda, Saludos