Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onChange on drop down box

Status
Not open for further replies.

Gill1978

Programmer
Jun 12, 2001
277
GB
Hi,

I've got a drop down box that should reload the same page whenever any of the options are selected.

However I get a Microsoft Development error;
"An exception of Type 'Microsoft jscript runtime error: object doesn't support this property or method' was not handled"

The JScript function looks like this:
<script Language=&quot;Jscript&quot;>
function doReload(reloadType) {
// if (result==false)
// return; // user canceled search
//else {
if (reloadType == true) {
window.focus();
window.location.reload(false); // Reload page
}
else {
window.parent.doReload(true);
};
}
</script>

and the drop down contains this;

<select size=&quot;1&quot; name=&quot;dropdown_menu&quot; onchange=doReload(this.value)>
<OPTION SELECTED value=&quot;&quot;>1
<OPTION value=&quot;true&quot;>2
</SELECT>

Can anyone see where i'm going wrong??

Julie
 
From what I can see, the way you're trying to retrieve the value from the dropdown object won't work.
Try to explicit use the object name:

...
if (dropdown_menu.value == true) {
window.focus();
window.location.reload(false); // Reload page
}
else {
window.parent.doReload(true);
};

 
I tried changing it to the above using

function reloadParent(load){
if (dropdown_menu.value == true) {
window.focus();
window.location.reload(false); // Reload page
}
else {
window.parent.reload(true);
};

}

But i get the Microsoft Development Environment error
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top