I'm stumped! I have two identical (as far as I can tell) <SELECT>'s
and I try to access their values with the same function. It works in
FireFox, but in IE it throws an error "Object doesn't support this
property or method." But it only throws the error on the second call
to the function (for <SELECT id=sortorder>) So it accepts the call for
<SELECT id=timespan> but not for <SELECT id=sortorder>
-----HTML-----
<SELECT name=timespan id=timespan style="background-color:
#5681AC; color: #FFFFFF; border: 1px solid #2f455c; padding: 2px;
text-align:left; font-weight: bold; outline-style: none;"
onChange="javascript:startover('restart');">
<OPTION value="86400">Past 24 hours</option>
<OPTION value="43200">Past 12 hours</option>
<OPTION value="28800">Past 8 hours</option>
<OPTION value="3600">Past hour</option>
<OPTION value="1800">Past 30 minutes</option>
<OPTION value="600">Past 10 minutes</option>
</select>
<SELECT name=sortorder id=sortorder style="background-color:
#5681AC; color: #FFFFFF; border: 1px solid #2f455c; padding: 2px;
text-align:left; font-weight: bold; outline-style: none;"
onChange="javascript:startover('restart');">
<OPTION value="quant">Quantity</option>
<OPTION value="severe">Severity</option>
</select>
-----JavaScript-----
timediff = WhatValSel('timespan');
sortorder = WhatValSel('sortorder'); // Here's where it throws the
error
function WhatValSel(selid) {
var tmp = document.getElementById(selid).selectedIndex;
return document.getElementById(selid).options[tmp].value;
}
Why do I only get an error on the second call to WhatValSel and not the
first?