Why are my drop down links not navigating to external websites?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • the coolest
    New Member
    • Nov 2010
    • 1

    Why are my drop down links not navigating to external websites?

    I am using the code below so that a drop down menu will allow users to choose and item from a list. The links should the navigate to an external website.

    However, the code I am using tries to open the link from within my site.

    For example, an item from my drop down would be Yahoo. When you click on Yahoo, it looks for yahoo.com in my site as though yahoo were a page in my site, not the actual yahoo.com. Please see the code below.

    Code:
    <script language="JavaScript">
    <!-- 
    function goToURL(form)
      {
    
        var myindex=form.dropdownmenu.selectedIndex
        if(!myindex=="")
          {
            window.location.href=form.dropdownmenu.options[myindex].value;
    
          
          }
    }
    //-->
    </script>
    <!--Paste code above between your head tags-->
    <!--Paste code below between your body tags-->
    <form name="Choose One">
    <select name="dropdownmenu" size=1 onChange="goToURL(this.form)">
    <option selected value="">
    Choose One
    <option value="www.arisnyc.org">
    ARIS
    <option value="www.yahoo.com">
    Yahoo
    <option value="">
    
    <option value="">
    
    <option value="">
    
    </select></form>
  • JKing
    Recognized Expert Top Contributor
    • Jun 2007
    • 1206

    #2
    Add http:// in front of your links.

    Comment

    Working...