Need help with coding a dropdown menu

Discussion in 'HTML & Website Design' started by grooveman, Oct 25, 2011.

  1. #1
    Should be simple, but I am having trouble with it. I have a dropdown menu on my website and I want the selected links to open in a new page. I tried adding target="_blank" and <form target="_blank"> in various places but no matter what I do it still opens the page in the same window. Below is a snippet of code from my form:

    <form method="get" enctype="application/x-www-form-urlencoded"><select style="font-family: 'Arial'; color: #000000; background-color: #ffffff; font-weight: normal; font-size: 10pt;" name="menu"><option selected="selected" value="http://www.nativeremedies.com/ailment/natural-treatments-face-body-acne.html?kbid=xxxxx">Acne</option> <option value="http://www.nativeremedies.com/ailment/natural-treatments-face-body-acne.html?kbid=xxxxx">Acne Vulgaris</option>

    (There are about 100 more products these are just a couple) The form ends with:

    </select><input style="font-family: 'Arial'; color: #006633; background-color: #ffffff; font-weight: bold; font-size: 12pt;" onclick="location=this.form.menu.options[this.form.menu.selectedIndex].value;" type="button" value="Go" />

    Any help would be appreciated
     
    grooveman, Oct 25, 2011 IP
  2. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #2
    Location uses the current page. Nothing you do, if you use location, is going to open a new page. If you use a <ul><li> dropdown menu (a "css menu"), you can add target="_blank" to your links.
     
    Rukbat, Oct 25, 2011 IP
  3. grooveman

    grooveman Peon

    Messages:
    595
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #3
    So what you are saying is that it is not possible the way it is structured? Sorry I'm not very knowledgable about this.
     
    grooveman, Oct 25, 2011 IP