Hi all-
Having some compatibility issues with my script to show different divs when a different option is selected in a drop-down menu (select form). It works in Firefox, but not Safari or IE). I'm sure this is really simple but I'm pretty new at this.
JAVASCRIPT
<script type='text/javascript'>
function showDiv(idOfDiv) {
document.getElementById(idOfDiv).style.display = 'block';
}
function hideDiv(idOfDiv) {
document.getElementById(idOfDiv).style.display = 'none';
}
</script>
HTML:
<select>
<option name="fieldName" id="field1" onclick="showDiv('AirOptions'); hideDiv('OceanOptions'); hideDiv('DomesticOptions');" onblur="hideDiv('div1');" selected="selected"/>Air Service</option>
<option name="fieldName" id="field2" onclick="showDiv('OceanOptions'); hideDiv('AirOptions'); hideDiv('DomesticOptions');">Ocean Service</option>
<option name="fieldName" id="field3" onclick="showDiv('DomesticOptions'); hideDiv('AirOptions'); hideDiv('OceanOptions');" onblur="hideDiv('div3');">Domestic Service</option>
</select>
<div id="AirOptions" style="display:none;">Air Services</div>
<div id="OceanOptions" style="display:none;">Ocean Services</div>
<div id="DomesticOptions" style="display:none">Domestic Services</div>
I could really use some help! Thanks in advance.