Jumping Java Jive
Reader David Netter writes: 'I use a dropdown list for site navigation, but at the moment it requires the user to select a page and then press a Go! button. I've seen sites which do the page jump automatically when the selection is done. How can I do this on my site?'
Our code is more flexible than many of the examples you'll find, because it can cope with multiple selection boxes. For example, you might have something like the following for features, news and off-site links:
<form action="redirect.pl" method="POST"> <SELECT NAME="select1" onChange="goToUrl('select1')"> <OPTION SELECTED VALUE="">Special Features</OPTION> <option value="features/this.asp">Feature One</option> <option value="features/mill.asp"> Millennium Bug</option> </SELECT><br> <SELECT NAME="select2" onChange="goToUrl('select2')"> <OPTION SELECTED VALUE="">News</OPTION> <option value="news/adreport.asp">Report on Net ads</option> <option value="news/that.asp">Another news item</option> </select><br> <SELECT NAME="select3" onChange="goToUrl('select3')"> <OPTION SELECTED VALUE="">Links</OPTION> <option value="http://www.microsoft.com"> Microsoft</option> <option value="http://www.netscape.com"> Netscape</option> <option value="http://www.pcpro.co.uk">A good read!</option> </select><br> <input type="Submit" value="Go!"> </form>
All articles Copyright CST Group Limited © 1997-2019
…provided us with extremely dedicated support over the years, Very responsive & knowledgeable.
— Khyati Patel, Malibu-Kahlúa International