How do I create a drop down list with hyperlinks?

K

Kathleen

I would like to create a drop down box listing other web sites. Tried some
stuff found on the web but nothing worked so far.
Thanks
 
S

Steve Easton

You really should use onClick with a Go button to fire the Onclick.
People who don't / can't use a mouse will only be able to open Google.

Try it using the Tab and Arrow keys and you'll see what I mean.

--
Steve Easton
Microsoft MVP FrontPage
95isalive
This site is best viewed..................
...............................with a computer

Dan L said:
This works for me:

<form>
<select onChange="if(options[selectedIndex].value)
window.location.href=(options[selectedIndex].value)">
<option>Select a site...
<option value="http://www.google.com">Google</option>
<option value="http://www.lycos.com">Lycos</option>
<option value="http://www.yahoo.lcom">Yahoo</option>
</select>
</form>

Kathleen said:
I would like to create a drop down box listing other web sites. Tried some
stuff found on the web but nothing worked so far.
Thanks
 
P

Paul M

Hi

Try this
Put it in the body tag

<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>

<form name="form1" id="form1" method="post" action="">
<div align="right">
<select name="menu1" onchange="MM_jumpMenu('parent',this,0)"
size="1">
<option>select your choice...</option>
<option value="http://www.google.co.uk/">google</option>
<option value="http://www.yahoo.com/">yahoo</option>
</select>
</div>
</form>
 
M

Mike

Kathleen said:
I would like to create a drop down box listing other web sites. Tried some
stuff found on the web but nothing worked so far.
Thanks

Very simple, but effective drop-down list.

<select size="1" onchange="window.location.href = options.value">
<option>Websites:</option>
<option value="http://www.google.ca">Google</option>
<option value="http://www.yahoo.com">Yahoo</option>
<option value="http://www.mamma.com">Mamma</option>
</select>
 
R

RG at UW

Dan, can you help me decide where to add the target="_blank" so the link
opens in a new window?
Thanks

Dan L said:
This works for me:

<form>
<select onChange="if(options[selectedIndex].value)
window.location.href=(options[selectedIndex].value)">
<option>Select a site...
<option value="http://www.google.com">Google</option>
<option value="http://www.lycos.com">Lycos</option>
<option value="http://www.yahoo.lcom">Yahoo</option>
</select>
</form>

Kathleen said:
I would like to create a drop down box listing other web sites. Tried some
stuff found on the web but nothing worked so far.
Thanks
 
T

Tom Pepper Willett

see below:

| Dan, can you help me decide where to add the target="_blank" so the link
| opens in a new window?
| Thanks
|
| "Dan L" wrote:
|
| > This works for me:
| >
| > <form>
| > <select onChange="if(options[selectedIndex].value)
| > window.location.href=(options[selectedIndex].value)">
| > <option>Select a site...
| > <option value="http://www.google.com" target="_blank">Google</option>
| > <option value="http://www.lycos.com" target="_blank">Lycos</option>
| > <option value="http://www.yahoo.lcom" target="_blank">Yahoo</option>
| > </select>
| > </form>

--
===
Tom "Pepper" Willett
Microsoft MVP - FrontPage
---
About FrontPage 2003:
http://office.microsoft.com/home/office.aspx?assetid=FX01085802
How to ask a newsgroup question:
http://support.microsoft.com/kb/555375
===
 
T

Thomas A. Rowe

Select the form on the page in FP, then under Form Properties you can set the target value. FYI: If
may appear grayed out, but you can still use the option.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================

RG at UW said:
Dan, can you help me decide where to add the target="_blank" so the link
opens in a new window?
Thanks

Dan L said:
This works for me:

<form>
<select onChange="if(options[selectedIndex].value)
window.location.href=(options[selectedIndex].value)">
<option>Select a site...
<option value="http://www.google.com">Google</option>
<option value="http://www.lycos.com">Lycos</option>
<option value="http://www.yahoo.lcom">Yahoo</option>
</select>
</form>

Kathleen said:
I would like to create a drop down box listing other web sites. Tried some
stuff found on the web but nothing worked so far.
Thanks
 
Top