Results 1 to 2 of 2

Thread: Drop Down Menu Links

  1. #1
    Join Date
    Sep 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Drop Down Menu Links

    please can anyone help ive got a drop down menu but i cant get it to link to my iframe... it justs loads the link in the page.... can anyone help ( ive tried the target= but it doesnt want to work!!

    <div id="Layer2" style="position:absolute; width:30px; height:30px; z-index:2; left: 310px; top: 10px; background-color: #000000; layer-background-color: #000000; border: 1px none #000000;">
    <iframe src="splash.html" name="web" frameborder="mo" marginheight="0" marginwidth="0" width="330" height="285"></iframe>
    </div>

    <br>
    <form name="menubar">
    <select style="font-size:12px;color:#ffffff;font-family:verdana;background-color:#000000;" name="menu" onChange="location=document.menubar.menu.options[document.menubar.menu.selectedIndex].value;">
    <option value=''>CLICK HERE</option>
    <option value="http://www.freewebs.com/avengethecrown/main.html">news</option>
    <option value="http://www.freewebs.com/avengethecrown/media.html" target="_top">the family</option>
    <option value="http://www.freewebs.com/avengethecrown/shows.html">shows</option>
    <option value="http://">downloads</option>
    <option value="http://">forum</option>
    <option value="http://">merch</option>
    <option value="http://">links</option>
    <option value="http://">contact</option>
    <option value="http://">myspace</option>

    </select>
    </form>

  2. #2
    Join Date
    Dec 2007
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You need Javascript to make links out of the select tag using the <option> tags.

    Code:
    <script type="text/javascript">
    <!--
    function dropdown(mySel)
    {
    var myWin, myVal;
    myVal = mySel.options[mySel.selectedIndex].value;
    if(myVal)
       {
       if(mySel.form.target)myWin = parent[mySel.form.target];
       else myWin = window;
       if (! myWin) return true;
       myWin.location = myVal;
       }
    return false;
    }
    //-->
    </script>
    Put the above code in your <head> tag.

    Then put this in the <form> tag:

    Code:
    <form action="../cgi-bin/redirect.pl" 
         method=post onSubmit="return dropdown(this.search)">
    And in the <select> tag, type this:

    Code:
    <select name="search">
    I hope this helps.

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
  •