Question : JavaScript OnChange Form Reload fails in Firefox but works in IE...

This is the Javascript code:

      function reload(form)
      {
            var val=advanced_search.search1.options[advanced_search.search1.options.selectedIndex].value;
            self.location='home.php?search1=' + val ;
            document.advanced_search.search1.selectedIndex ;
      }


Top of the form:

<form method="post" name="advanced_search" action='search_advanced.php'>
                              <tr>
                              <td align="center">
                                    <select name="search1" onchange="reload(this.advanced_search)">

For some reason it just seems to fail in FireFox, IE works fine any ideas?

Thanks

Answer : JavaScript OnChange Form Reload fails in Firefox but works in IE...

Use :

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
function reload(form)
	{
		var sb = form.search1;
		var val = sb.options[sb.selectedIndex].value;
		self.location = 'home.php?search1=' + val ;
		form.search1.selectedIndex; // too late!
	}

and :

<select name="search1" onchange="reload(this.form)">
Random Solutions  
 
programming4us programming4us