473,406 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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.

Expand|Select|Wrap|Line Numbers
  1. <script language="JavaScript">
  2. <!-- 
  3. function goToURL(form)
  4.   {
  5.  
  6.     var myindex=form.dropdownmenu.selectedIndex
  7.     if(!myindex=="")
  8.       {
  9.         window.location.href=form.dropdownmenu.options[myindex].value;
  10.  
  11.  
  12.       }
  13. }
  14. //-->
  15. </script>
  16. <!--Paste code above between your head tags-->
  17. <!--Paste code below between your body tags-->
  18. <form name="Choose One">
  19. <select name="dropdownmenu" size=1 onChange="goToURL(this.form)">
  20. <option selected value="">
  21. Choose One
  22. <option value="www.arisnyc.org">
  23. ARIS
  24. <option value="www.yahoo.com">
  25. Yahoo
  26. <option value="">
  27.  
  28. <option value="">
  29.  
  30. <option value="">
  31.  
  32. </select></form>
  33.  
Nov 8 '10 #1
1 1646
JKing
1,206 Expert 1GB
Add http:// in front of your links.
Nov 8 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

46
by: Kingdom | last post by:
In my data base I have a list of componet types e.g. type A - I have 8 off - type B I have 12 off etc. I'm using Set objRS = objDC.Execute("Select DISTINCT Component_Type FROM Parts_Table") ...
2
by: ehm | last post by:
I am working on creating an editable grid (for use in adding, deleting, and editing rows back to an Oracle database). I have a JSP that posts back to a servlet, which in turns posts to a WebLogic...
10
by: Haines Brown | last post by:
I've implemented the horizontal drop down menu discussed recently in this newsgroup, and it works nicely under Galeon and Mozilla, but not IE 5.0. Here are the problems: Under IE 5.0, the...
3
by: excel_hari | last post by:
Hi, I couldnt locate a Classic ASP group hence posting here. One of my colleagues has designed an intranet site and one of the pages has a drop-down box with close to 300 options. I want to...
3
by: lewisthesmith | last post by:
I'm not really sure if this is a CSS issue, but people here before have been knowledgeable and friendly and so it seems like a good place to start. I'm in the process of building a new site for...
4
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me...
1
by: Kaland | last post by:
Do the search engines follow links that are within forms (like the drop-down menu) so that those pages are indexed? Here is the code for a sample drop-down menu that I created. <form><select...
0
by: lillizzierae | last post by:
hey. i have a drop down menu on my site. i want my main top button on the bar to be hot but i can't get it to be a link. the reason being, or at least i think the reason being, is the rel...
5
by: mramsay | last post by:
HI, I'm having alot of problems trying to figure out how to create drop down links from a hyperlink on my homepage. I have a hyperlink called Programs (this is for a community centre) When...
0
by: mjohnson0321 | last post by:
I am trying to incorporate a CSS drop-down menu into a site (suckerfish menu). The menu gets lost behind the content below it, but only on one of the drop downs (News). The error occurs on all of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.