HTML dropdown box question.

Discussion in 'HTML & Website Design' started by Proxyhub, Mar 24, 2007.

Thread Status:
Not open for further replies.
  1. #1
    Well, when I am making a drop down box, how could i have it surf to another website?
     
    Proxyhub, Mar 24, 2007 IP
  2. Alam

    Alam Active Member

    Messages:
    316
    Likes Received:
    91
    Best Answers:
    0
    Trophy Points:
    68
    #2
    You can try

    <html>

    <head>
    <script language="JavaScript">
    <!--
    function MM_jumpMenu(targ,selObj,restore)
    { //v3.0
    eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
    if (restore) selObj.selectedIndex=0;
    }
    //-->
    </script>
    </head>

    <body>

    <form name="form1">
    <select name="menu1" onChange="MM_jumpMenu('parent',this,0)">
    <option value="http://www.google.com" selected>Google</option>
    <option value="http://www.yahoo.com">Yahoo!</option>
    <option value="http://www.msn.com">MSN</option>
    </select>
    </form>

    </body>

    </html>
     
    Alam, Mar 25, 2007 IP
  3. Valve-Hosting

    Valve-Hosting Peon

    Messages:
    1,071
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yeah, its really simple. If you're doing it in DW just place the full url in the option or if not just follow the example above.
     
    Valve-Hosting, Mar 25, 2007 IP
Thread Status:
Not open for further replies.