• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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

 
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Sheriff
Posts: 67590
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
This cake looks terrible, but it tastes great! Now take a bite out of this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic