update the focus of <select> menu after reloading the page

I have a form that auto submits to itself when an onchange event occurs.  What I can't figure out is how do I now get it so that the menu's focus is now on the value that was previously selected?  Here's the code without database stuff.

<form action="test.asp" method="get" name="form1">
   <select name="options" onChange=document.form1.submit()>
      <option value="1">first</option>
      <option value="2">second</option>
      <option value="3">third</option>
   </select>
</form>

So now when someone selects an option, for example option two, then the page reloads itself and the url will now be:  test.asp?options=2

so now i would probably do a request.form("options") to get the value, but what do I need to write in order for the menu dropdrop to have option two displayed instead of the first option?

The only way I can think of is to have two recordsets.  The first one only has the value selected and the other one has the rest of the options.  I'm sure there is a better way.  Any suggestion?
smikAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

StormyWatersCommented:
Is your select menu built from a database?
 If so, then check to see if the value you're outputting == request.form("options"); and if so echo " selected" before closing the option tag.

Sorry if I'm not grasping the problem right.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
smikAuthor Commented:
okay, that worked.

i just need to write <option value="whatever" selected>whatever</option> for the one that i want selected.

That was a pretty stupid question...


0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.