This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Pull-down menus: How to scroll down to first pre-selected option Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Pull-down menus: How to scroll down to first pre-selected option" Watch "Pull-down menus: How to scroll down to first pre-selected option" New topic
Author

Pull-down menus: How to scroll down to first pre-selected option

Rick Portugal
Ranch Hand

Joined: Dec 17, 2002
Posts: 243
Hi,

I have a form that has a pull-down menu. I am using the html:select tag and the html ptionsCollection tag for the pull-down menu.

There are many options and some of the options are pre-selected. Each time the user enters the form, he has to scroll through the list to tell which options are pre-selected. Is there any way to have the system automatically scroll down to the first pre-selected option?

Can that be done using some html:select option, or maybe native HTML?


IBM 286, SCJP, SCWCD, EIEIO
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61451
    
  67

Originally posted by Rick Portugal:

Can that be done using some html:select option, or maybe native HTML?


Firstly, whether you use the JSP custom tags or not to create the form element, it is "native HTML" that is being sent to the browser. All the tags do for you is to compose the HTML; the browsers themselves know and see nothing but native HTML.

Secondly, there is no means that I am aware of to affect the behavior of the select element in the manner that you describe.

You might want to consider using a select list, as opposed to a dropdown, which shows more elements at a glance.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pull-down menus: How to scroll down to first pre-selected option