This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Drop down without scrollbar" Watch "Drop down without scrollbar" New topic
Author

Drop down without scrollbar

Shane W
Ranch Hand

Joined: Aug 31, 2007
Posts: 30
Hi
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)

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

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

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
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
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?

Eric
Dan Drillich
Ranch Hand

Joined: Jul 09, 2001
Posts: 1164
Please have a look at http://forums.digitalpoint.com/showthread.php?t=3374


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: http://aspose.com/file-tools
 
subject: Drop down without scrollbar
 
Similar Threads
Tooltip on html:select
retrieve value of a field
enable/disable drop down
Using SELECTED in an html:option tag
Passing data from servlet to JSP to servlet