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 3 of 3
  1. #1
    Regular Coder
    Join Date
    May 2005
    Posts
    220
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Form Drop Down Link to page?

    In this example, How can I make the form work so that when you choose the drop down list that the link that you choose will take you to pagea.html or pageb.html?

    <form>
    <select name="NAME">
    <option>Page A
    <option>Page B
    </select>
    </form>

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <script type="text/javascript">
    <!--
    function change(url){
    if(url=="none"){
    return false;
    }
    else {
    window.location=url;
    }
    }
    //-->
    </script>
    </head>
    
    <body>
    <select onchange="change(this.value)" name="blah">
    <option value="none">Select a Page</option>
    <option value="http://www.codingforums.com">Coding Forums</option>
    <option value="http://www.google.com">Google</option>
    <option value="http://www.yahoo.com">Yahoo</option>
    </select>
    </body>
    </html>

  • #3
    Regular Coder
    Join Date
    May 2005
    Posts
    220
    Thanks
    1
    Thanked 2 Times in 2 Posts

    thanks

    Dude! Thanks!


  •  

    Posting Permissions

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