Avatar of rmardis
rmardis

asked on 

javascript

This function below works fine on the onload="CheckSelected();"

Which is necessary to hide the elements within <div id="shannon"><div> when the page loads.  The value_ShipCounty is a lookup box which when clicks fills text fields on the form.  By default the selection is blank when the page loads so the onload code is hiding the <div> section.

Now i need to get this code to execute if the dropdown is changed
<script>
function CheckSelected() {
if ( (document.getElementById("value_ShipCounty").selectedIndex <= 0)) {
  
 document.getElementById('shannon').style.display='none';
 
 
}
if ( (document.getElementById("value_ShipCounty").selectedIndex > 0)) {
  
 document.getElementById('shannon').style.display='inline';
 
 
}
}
</script>

Open in new window

JavaScriptHTML

Avatar of undefined
Last Comment
Zvonko

8/22/2022 - Mon