arnyinc
01-28-2005, 03:07 PM
I can't figure out why my function gives me an error. The function works, but it also gives me the error "Could not set the selected property. Unspecified error". If it makes any different, I only get the error in IE never in Firefox.
function setDropdown(mydd, defaultValue){
for (var i=0; i<mydd.length; i++)
if (mydd.options[i].value==defaultValue)
mydd.options[i].selected=true; //this is the line with the error
}
I call it when I load the page:
<body onload="setDropdown(myform.filterowner, '11');">
I've also tried:
<body onload="setDropdown(document.myform.filterowner, '11');">
function setDropdown(mydd, defaultValue){
for (var i=0; i<mydd.length; i++)
if (mydd.options[i].value==defaultValue)
mydd.options[i].selected=true; //this is the line with the error
}
I call it when I load the page:
<body onload="setDropdown(myform.filterowner, '11');">
I've also tried:
<body onload="setDropdown(document.myform.filterowner, '11');">