/    Sign up×
Community /Pin to ProfileBookmark

Drop down select issue with Netscape

my Drop down select pulls up a page when selected without hitting any submit button.
It works in my IE but not in my Netscape 4.77 browser. In Netscape 4.77 it gives me a page error saying page cannot be found.

Please advise.

[code]
<form name=”test”>
<SELECT NAME=”view” SIZE=”1″ onChange=”document.location=this.value”>
<OPTION VALUE=”http://webserver/pageOne.cfm”>View Page One</OPTION>
<OPTION VALUE=”http://webserver/pageTwo.cfm”>View Page Two</OPTION>
</SELECT>

</form>
[/code]

I also tried:

[code]
<form name=”test”>
<SELECT NAME=”view” SIZE=”1″ onChange=”document.location=test.view.value”>
<OPTION VALUE=”http://webserver/pageOne.cfm”>View Page One</OPTION>
<OPTION VALUE=”http://webserver/pageTwo.cfm”>View Page Two</OPTION>
</SELECT>

</form>
[/code]

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@oleragDec 12.2003 — I believe you'll need to iterate thru the selection list.

Below is some example code that puts the selected item's

value into an alert. You can change it to fit your requirements. Tested with IE5,6 and Net 4.7x,7x.

[code=php]
<html>
<head>
<script type="text/javascript">
function showSelected(listObj) {
for (var i=0;i<listObj.length;i++) {
if (listObj.options[i].selected) {
alert("Value: " + listObj.options[i].value);
break;
}
}
}
</script>
</head>
<body>
<center>
<b>Selection Test</b>
<p>
<form>
<select name="selectList1" size="1" onChange="showSelected(this)">
<option value="URL 1">Item #1</option>
<option value="URL 2">Item #2</option>
<option value="URL 3">Item #3</option>
<option value="URL 4">Item #4</option>
</select>
</form>
</center>
</body>
</html>
[/code]
Copy linkTweet thisAlerts:
@oleragDec 12.2003 — Sorry - the previous function can be replaced with this if you

also add a "non-entry" list item as the first value so nothing

is initally depicted...

[code=php]
function showSelected(listObj) {
var val;
for (var i=0;i<listObj.length;i++) {
if (listObj.options[i].selected) {
val = listObj.options[i].value;
if (val.length > 0) {
alert("Value: " + val);
}
break;
}
}
}
[/code]


Support html for the selection list is...

<select name="selectList1" size="1" onChange="showSelected(this)">

<option value=""></option>

<option value="URL 1">Item #1</option>

<option value="URL 2">Item #2</option>

<option value="URL 3">Item #3</option>

<option value="URL 4">Item #4</option>

<option value="URL 5">Item #5</option>

<option value="URL 6">Item #6</option>

<option value="URL 7">Item #7</option>

</select>
Copy linkTweet thisAlerts:
@floridaauthorDec 12.2003 — Thanks!
×

Success!

Help @florida spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...