/    Sign up×
Community /Pin to ProfileBookmark

Select box, change on select

I would like a select box in a form that changes the page on the select. I have some code written but its not working. Please take a look:

[CODE]

<form name=”sort” method=”post”>
<select onchange=”RedirectToAddADDress.value”>

<option value=”products.asp?dept=<%=session(“department”)%>&amp;pagenumber=1&amp;sort_on=number&amp;sort_by=DESC”>Desc</option>

<option value=”products.asp?dept=<%=session(“department”)%>&amp;pagenumber=1&amp;sort_on=number&amp;sort_by=ASC”>Asc</option>

</select>
</form>

[/CODE]

I know the option values are correct, it has to be the “onchange” command… does anyone know what to put there so that it works? Thanks ?

Jon

to post a comment
HTML

2 Comments(s)

Copy linkTweet thisAlerts:
@FangJul 09.2007 — onchange="window.location.href=this.value"
Only the second option can be [I]this.value[/I], unless you add a first option 'select one of the options'
&lt;form name="sort" method="post"&gt;
&lt;select onchange="window.location.href=this.value"&gt;
&lt;option&gt;select one of the options&lt;/option&gt;
&lt;option value="products.asp?dept=&lt;%=session("department")%&gt;&amp;amp;pagenumber=1&amp;amp;sort_on=number&amp;amp;sort_by=DESC"&gt;Desc&lt;/option&gt;

&lt;option value="products.asp?dept=&lt;%=session("department")%&gt;&amp;amp;pagenumber=1&amp;amp;sort_on=number&amp;amp;sort_by=ASC"&gt;Asc&lt;/option&gt;

&lt;/select&gt;
&lt;/form&gt;
Copy linkTweet thisAlerts:
@JontronauthorJul 09.2007 — Thank you for the help ?
×

Success!

Help @Jontron 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 6.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...