Click to See Complete Forum and Search --> : reset dropdowns function not working in IE, why?


sanjuT
09-19-2003, 09:57 AM
This works in Netscape 4.76, but not IE 6...anyone know why?

This is called when a button is pressed. it resets 4 dropdowns to the first selection(dropdowns used as search criteria).
the page is reloaded, so that that a search is returning all data (because the first selection of each dropdown is selected, which is 'No Filter')



<SCRIPT language="javascript">
function resetfilter() {

document.filtermenus.developer.options[0].selected=true;
document.filtermenus.priority.options[0].selected=true;
document.filtermenus.status.options[0].selected=true;
document.filtermenus.contact.options[0].selected=true;

window.location.reload();

}
</script>

Thanks!!

pyro
09-19-2003, 10:08 AM
Try:

document.formname.selectname.options.selectedIndex = 0;

sanjuT
09-19-2003, 10:32 AM
I tried that, but i still get the error.

i have attached what i get when i try to reset the dropdowns in IE.

When i click 'retry', i just get the previous page (with the dropdown still selected).

Fang
09-20-2003, 05:53 AM
What type of button was pressed?
If a submit button was pressed then it's logical that you get this warning.

sanjuT
09-22-2003, 09:07 AM
This is the button i used:


<input type="reset" name="Reset" value= "Reset filters" onClick = "resetfilter();">