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';"> </select> <div id="otherdetail2" style="display: none;"> <table class="nuevo_paciente" width="100%"> <tr> <td align=center> </td> </tr> <tr> <td> <select name="farmaco_prev" id="transfer_reason2" style="width:100%;float:left;margin-right:10px; " > </select> </td> </tr> </table> </div>
Espero su ayuda, Saludos