Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drop Down Box Question

Status
Not open for further replies.

lmoe

IS-IT--Management
Mar 1, 2004
168
US
In a drop down box is VALUE supposed to let you link your option to another web page? If not, where do I do this?

LMC
IT/MIS
"Never stop learning.
 
Hi lmoe,

The script I use is a little cumbersome, as it requires a <Head> script to be placed on every page where the menu appears. Call me crazy, but it has worked faithfully for me, so I stick with it.

Place the following in the <Head> section.

Code:
<script language="JavaScript">
<!-- 
function goToURL(form)
{

var myindex=form.dropdownmenu.selectedIndex
if(!myindex=="")
{
window.location.href=form.dropdownmenu.options[myindex].value;


}
}
//-->
</script>

Place the next part in the <Body> where you wish the menu to appear.

Code:
<form>
<p align="right"><select name="dropdownmenu" size="1" onChange="goToURL(this.form)" 
 <option selected>Example
  Box</option>
  <option value="index.html">Name
  here</option>
  <option value="index.html">Name
  here</option>
  <option value="index.html">Name
  here</option>
  <option value="index.html">Name
  here</option>

</select>
</form>

The script requires not changing the name of the form, unless you change references in the script as well. Additionally, you can use multiple DDs on the same page as long as the name is the same.

Hope I have been of some help,
Micheal

FrontPage Form Tutorials & Form Script Examples
 
Thanks.... I will try this.

LMC
IT/MIS
"Never stop learning.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top