aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes combo box length Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "combo box length " Watch "combo box length " New topic
Author

combo box length

sreejith panampilly
Ranch Hand

Joined: Jun 15, 2006
Posts: 49
How can set default length to a combo box ?
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

If you mean the number of visible rows, you can use the "size" attribute.


[My Blog]
All roads lead to JavaRanch
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

<select... size = integer>

SIZE indicates how many rows of the list should be displayed. The default is one.


Saifuddin..
[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
sreejith panampilly
Ranch Hand

Joined: Jun 15, 2006
Posts: 49
guys i mean the width of the combobox
usually width is up to the longest string..
karthikeyan Chockalingam
Ranch Hand

Joined: Sep 06, 2003
Posts: 259
Apply style Cascading Style Sheets (CSS) to the select box


http://www.skillassert.com


Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Set th width with css, but!!! IE 6 and under chops off the overflow and you can not see it.

Eric
Susanta Chatterjee
Ranch Hand

Joined: Aug 12, 2002
Posts: 102
We used the following inline style to do the same thing.



That restricts the width for Select control to 130 pixels, does not depend on the Option string width. There was a problem with that. Users complained that they needed to see the full text of the selected option. So, we provided a popup to be displayed on mouse over on select.

- Susanta
sreejith panampilly
Ranch Hand

Joined: Jun 15, 2006
Posts: 49
Thanks for the information.

Please provide the code for the popup to be displayed on mouse over on select.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61066
    
  66

Originally posted by sreejith panampilly:
Please provide the code for the popup to be displayed on mouse over on select.


sreejith panampilly, you mistake the purpose of JavaRanch. It's not a code mill where you can demand that other people write your code for you. It is a learning site where you are expected to do your own work and come here for help with any issues.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
sreejith panampilly
Ranch Hand

Joined: Jun 15, 2006
Posts: 49
ok sorry Bear Bibeault
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: combo box length