Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

drop down select menu to load link

Posted on 2010-09-14
5
Medium Priority
?
274 Views
Last Modified: 2012-05-10
Hello All,

I need to set up a html drop down menu that sends the user to a specific url upon clicking the choice. Any help would be great. I will attach the code below. Thanks.
<select class="fl" style="padding:6px 8px;height:32px;margin-right:10px;">
  <option>Pick a region</option>
  <option>New York</option>
  <option>Philidelphia</option>
  <option>Pittsburg</option>
  <option>Tampa Bay</option>
</select>
<a href="javascript:void(0);" class="button">Ok</a>

Open in new window

0
Comment
Question by:yando18
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 19

Expert Comment

by:erikTsomik
ID: 33676883
you can do something like this
<select onchange="window.open(this.options[this.selectedIndex].value,'_top')" class="fl" style="padding:6px 8px;height:32px;margin-right:10px;">

    <option value=">Pick a region</option>
  <option value="http://newyour.com">New York</option>
  <option value="http://Philidelphia.com">Philidelphia</option>
  <option>Pittsburg</option>
  <option>Tampa Bay</option>
</select>
0
 
LVL 13

Expert Comment

by:darren-w-
ID: 33676902
0
 
LVL 60

Expert Comment

by:HainKurt
ID: 33676979
or something like this
<script>
function openURL(url){
  if (url != "") window.open(url,'_top');
}
</script>

<select onchange="openURL(this.value)" class="fl" style="padding:6px 8px;height:32px;margin-right:10px;">
  <option value="">Pick a region</option>
  <option value="http://newyork.com">New York</option>
  <option value="http://Philidelphia.com">Philidelphia</option>
  <option value="http://Pittsburg.com">Pittsburg</option>
  <option value="http://TampaBay.com">Tampa Bay</option>
</select>

Open in new window

0
 
LVL 60

Accepted Solution

by:
HainKurt earned 1000 total points
ID: 33676994
or this using a button
<script>
function openURL(url){
  if (url != "") window.open(url,'_top');
}
</script>

<select id=selURL class="fl" style="padding:6px 8px;height:32px;margin-right:10px;">
  <option value="">Pick a region</option>
  <option value="http://newyork.com">New York</option>
  <option value="http://Philidelphia.com">Philidelphia</option>
  <option value="http://Pittsburg.com">Pittsburg</option>
  <option value="http://TampaBay.com">Tampa Bay</option>
</select>

<a href="javascript:openURL(selURL.value);" class="button">Ok</a>

Open in new window

0
 

Author Comment

by:yando18
ID: 33678285
Thanks I will give some of these a shot.
0

Featured Post

Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
CTAs encourage people to do something specific to show interest in your company, product or service. Keep reading to learn why CTAs should always be thought of as extremely important, albeit small, sections of websites.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question