Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder Common's Avatar
    Join Date
    Jan 2009
    Location
    Glasgow, UK
    Posts
    133
    Thanks
    16
    Thanked 13 Times in 13 Posts

    <select> menu onClick

    Yo, this is really really basic...

    So I want a drop down menu which when you click the <option> row you want, it loads a page there and then (just like clicking a link) rather than having to press a form submit button.

    I had something along the lines of this:
    Code:
    <select><option onClick="parent.location='cheese.html';">Cheese</option></select>
    But that only works in Firefox... what can I doooo?

    Thanks. =)

  • #2
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,077
    Thanks
    38
    Thanked 498 Times in 492 Posts

    Lightbulb Select Menu

    How about this ...
    Code:
    <html>
    <head>
    <title>SBox Menu</title>
    </head>
    <body>
    <h1>Select Menu</h1>
    <select onchange="if(this.value!=''){document.location.href=this.value}">
    <option value="">Select location</option>
    <option value="http://www.codingforums.com">CodingForums</option>
    <option value="http://www.webdeveloper.com">Webdeveloper</option>
    <option value="http://www.javascript.com">JavaScript</option>
    </select>
    </body>
    </html>

  • Users who have thanked jmrker for this post:

    Common (01-19-2009)

  • #3
    Regular Coder Common's Avatar
    Join Date
    Jan 2009
    Location
    Glasgow, UK
    Posts
    133
    Thanks
    16
    Thanked 13 Times in 13 Posts
    Thanks for that, works fine. =)

  • #4
    Senior Coder jmrker's Avatar
    Join Date
    Aug 2006
    Location
    FL
    Posts
    3,077
    Thanks
    38
    Thanked 498 Times in 492 Posts
    You're most welcome.
    Glad I was able to help.
    Good Luck!


  •  

    Posting Permissions

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