INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Linking

How can I make a drop down list of links using <select>? by RISTMO
Posted: 31 Dec 02

There are two ways to make a list of links using the <select> tag. Here they are:

This will make the links in a drop-down form:

<script>
<!--
function goto(choose){
var selected=choose.options[choose.selectedIndex].value;
    if(selected != ""){
    location.href=selected;
    }
}
//-->
</script>
<SELECT onChange="goto(this);">
<option value="">--Jump to a page--</option>
<option value="page1.html">Page 1</option>
<option value="page2.html">Page 2</option>
<option value="page3.html">Page 3</option>
</SELECT>



This example will make the links in list form:
<script>
<!--
function goto(choose){
var selected=choose.options[choose.selectedIndex].value;
    if(selected != ""){
    location.href=selected;
    }
}
//-->
</script>
<SELECT onChange="goto(this);">
<option value="">--Jump to a page--</option>
<option value="page1.html">Page 1</option>
<option value="page2.html">Page 2</option>
<option value="page3.html">Page 3</option>
</SELECT>

Rick Morgan

Back to HTML, XHTML & CSS FAQ Index
Back to HTML, XHTML & CSS Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close