Results 1 to 3 of 3

Thread: How to do this

  1. #1
    Join Date
    Mar 2009
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to do this

    Hi,

    I am trying to design a drop down menu list for my website. I want to set an action that when someone select the product from dropdown list the browser should redirect the user to that page without pushing any GO button beside the dropdown menu. I have my links ready. I know html but what about javascript.
    I designed html but i dont know how to redirect.

    <select name="category">
    <option value="www.yahoo.com">Liz claiborne</option>
    <option value="www.google.com">Curve</option>
    <option value="link3">ck</option>
    <option value="link4>">Liz</option>
    </select>

    what next.

    Thanks in advance

  2. #2
    Join Date
    Jun 2007
    Posts
    543
    Thanks
    3
    Thanked 78 Times in 78 Posts
    Blog Entries
    1

    Default

    [Jasme Library (Javascript Motion Effects)] My Site
    /\/\@§†ê® §©®¡þ† /\/\@|{ê®
    There are 10 kinds of people in the world, those that understand binary and those that don't.

  3. #3
    Join Date
    Jun 2008
    Posts
    589
    Thanks
    13
    Thanked 54 Times in 54 Posts
    Blog Entries
    1

    Default

    Use the onchange event in your menu. Here's some code:

    Code:
    <select name="category" onchange="location.href = this.options[this.selectedIndex].value;">
    <option value="www.yahoo.com">Liz claiborne</option>
    <option value="www.google.com">Curve</option>
    <option value="link3">ck</option>
    <option value="link4>">Liz</option>
    </select>
    Just use the onchange event handler and copy and paste it onto other menus if they have the same characteristics. Questions?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •