Jump to content

Forms - Drop Down Menus

Recommended Posts

I have a html form drop down menu, and i wanted to make it so that when an option is selected, it automatically goes to a particular link. How do i put links into this code? Thanks! <select name="select" size="1" id="select"> <option selected>Select an Option</option> <option>Option 1 </option> <option>Option 2</option> <option>Option 3</option> </select>

Link to post
Share on other sites

Put the URL in the option value and write the code as follows:

<select onchange="location.href=this.value" size="1"><option selected="selected">Select an Option</option><option value="http://www.google.com">Google</option><option value="http://www.yahoo.com">Yahoo!</option><option value="http://www.w3schools.com">W3Schools</option></select>

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...