and my javascript function is just a simple style.visibility='visible'; function to show a hidden div, but it seems to only work if I change the onchange event to this.value, which won't work for me. I need the value to be the id of the report from the db and the name as the type so I know which div to show/hide. Is there a way to pass the name to a function?
<select id='report' onchange="setOptions()">
<option value=''>------Select A Report------</option>
<option value='1' name='1'>Active Accounts with Date Range</option></select>
and this as my javascript function called "setOptions()"...
function setOptions() {
var sel = document.getElementById("report");
var val = sel.options[sel.selectedIndex].name;
if(val == 1) {
var date = document.getElementById("daterange");
date.style.visibility = "visible";
}
}
but it doesn't show the div unless I change the val to "var val = sel.options[sel.selectedIndex].value;" but I can't base the show/hide on the value, it has to be based on the name= part