my dog learned polymorphism
The moose likes HTML, CSS and JavaScript and the fly likes Drop down without scrollbar Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Drop down without scrollbar" Watch "Drop down without scrollbar" New topic

Drop down without scrollbar

Shane W
Ranch Hand

Joined: Aug 31, 2007
Posts: 30
I need to show some items in a drop down but with out a scroll bar.I've used html select with the size attribute but still keep getting the scrollbar.there would be at max.elements in the drop down(fetched from DB)

<html:select property="myEvent" name="myForm" size="20" styleClass="smalldropdown"
<htmlption value="select" >Select</htmlption>
<logic:iterate id="reg" scope="session" property="myEventList" name="myForm">
<htmlption value="<%=(String)reg.toString()%>">
<bean:write name="reg" />

As this dropdown is on the top of the page,the user does'nt want to scroll and wants to see the complete dropdwon.
[ September 20, 2007: Message edited by: Shane Warne ]
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Moving to our HTML/Javascript forum

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15385
IF you are saying there are more than 20 options you still get a scrollbar? Why don't you make the size dynamic by looking at the number of elements in your database and setting that count to the size attribute?

Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1183
Please have a look at

William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
I agree. Here's the link:
subject: Drop down without scrollbar
It's not a secret anymore!