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!

Why does this script work in IE and not Navigator

Status
Not open for further replies.

Mtneer

IS-IT--Management
Apr 1, 2002
6
US
The following javascript works in IE, but not Navigator, and I can't figure out why!Does anyone have any ideas!Thank you!
Code:
<script language=&quot;JavaScript&quot;>
<!-- Hide the script from old browsers --
function surfto(form) {
var myindex=form.dest.selectedIndex
window.open(form.dest.options[myindex].value, target=&quot;_top&quot;);
}
//-->
</SCRIPT>
<select onChange=&quot;window.location.href=this.options[this.selectedIndex].value;&quot;>
<option value=&quot;&quot; selected> Enemy Boards </option>
<OPTION VALUE=&quot;[URL unfurl="true"]Http://boards.rivals.com/default.asp?sid=74&amp;p=16&quot;>WVU</option>[/URL]
<OPTION VALUE=&quot;[URL unfurl="true"]Http://boards.rivals.com/default.asp?sid=100&amp;p=16&quot;>BC</option>[/URL]
<OPTION VALUE=&quot;[URL unfurl="true"]Http://boards.rivals.com/default.asp?sid=139&amp;p=16&quot;>UConn</option>[/URL]
<OPTION VALUE=&quot;[URL unfurl="true"]http://boards.rivals.com/default.asp?sid=42&amp;p=16&quot;>OleMiss</option>[/URL]
<OPTION VALUE=&quot;[URL unfurl="true"]Http://boards.rivals.com/default.asp?sid=295&amp;p=16&quot;>Gtown</option>[/URL]
<OPTION VALUE=&quot;[URL unfurl="true"]Http://boards.rivals.com/default.asp?sid=86&amp;p=16&quot;>Miami</option>[/URL]
<OPTION VALUE=&quot;[URL unfurl="true"]Http://boards.rivals.com/default.asp?sid=1071&amp;p=16&quot;>ND</option>[/URL]
<OPTION VALUE=&quot;[URL unfurl="true"]Http://boards.rivals.com/default.asp?sid=89&amp;p=16&quot;>Pitt</option>[/URL]
<OPTION VALUE=&quot;[URL unfurl="true"]Http://boards.rivals.com/default.asp?sid=348&amp;p=16&quot;>Prov</option>[/URL]
<OPTION VALUE=&quot;[URL unfurl="true"]Http://boards.rivals.com/default.asp?sid=122&amp;p=16&quot;>Rutgers</option>[/URL]
<OPTION VALUE=&quot;[URL unfurl="true"]Http://boards.rivals.com/default.asp?sid=230&amp;p=16&quot;>SJU</option>[/URL]
<OPTION VALUE=&quot;[URL unfurl="true"]Http://boards.rivals.com/default.asp?sid=365&amp;p=16&quot;>S[/URL] Hall</option>
<OPTION VALUE=&quot;[URL unfurl="true"]Http://boards.rivals.com/default.asp?sid=54&amp;p=16&quot;>Cuse</option>[/URL]
<OPTION VALUE=&quot;[URL unfurl="true"]http://boards.rivals.com/default.asp?sid=109&amp;p=16&quot;>Temple</option>[/URL]
<OPTION VALUE=&quot;[URL unfurl="true"]Http://boards.rivals.com/default.asp?sid=176&amp;p=16&quot;>Nova</option>[/URL]
<OPTION VALUE=&quot;[URL unfurl="true"]Http://boards.rivals.com/default.asp?sid=77&amp;p=16&quot;>VT</option>[/URL]
</SELECT>
 
check out forums and docs for &quot;DOM&quot; issues : the Document Object Model isn't the same for ie and netscape - you don't refer to objects in the same way
 
Hi Mtneer,

Make sure your <select> tag is within the <form> tag,
for example,

<form>
<select>
<option value=&quot;&quot; selected> Enemy Boards </option>
....
....
</select>
</form>

hope this helps,
Chiu Chan
cchan@gefmus.com
 
and the form name has to be &quot;form&quot; if you want to keep your function as it is
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top