Solved

drop down select menu to load link

Posted on 2010-09-14
5
264 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
5 Comments
 
LVL 19

Expert Comment

by:erikTsomik
Comment Utility
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-
Comment Utility
0
 
LVL 51

Expert Comment

by:HainKurt
Comment Utility
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 51

Accepted Solution

by:
HainKurt earned 250 total points
Comment Utility
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
Comment Utility
Thanks I will give some of these a shot.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
This tutorial walks through the best practices in adding a local business to Google Maps including how to properly search for duplicates, marker placement, and inputing business details. Login to your Google Account, then search for "Google Mapmaker…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now