Inside Technique : Navigation Lists
To demonstrate, try the sample list below. The destination URL is displayed in a message box rather than navigating you to the page:
Defining a list is as simple as adding a form to your page:
The onchange event is executed every time a new choice is selected from the list. When the user selects an item, the URL is taken from the VALUE attribute on the selected OPTION element. Before the navigation actually occurs, the user's selection is reset to the first item. This is necessary as browsers may cache the last selected value. By always reverting back to the first item, you are ensuring that the user sees the "Where do you want to go?" message every time they enter the page.
You will also notice the first item also has a color specified with an in-line style sheet. At this time, this color is only displayed in Internet Explorer 4.0, and has no effect on other browsers. It was included to demonstrate how you can provide an improved appearance using style sheets to some of your users without adversely effecting the experience for others.
© 1997-2000 InsideDHTML.com, LLC. All rights reserved.