Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

combo box length

 
sreejith panampilly
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can set default length to a combo box ?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you mean the number of visible rows, you can use the "size" attribute.
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<select... size = integer>

SIZE indicates how many rows of the list should be displayed. The default is one.
 
sreejith panampilly
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
guys i mean the width of the combobox
usually width is up to the longest string..
 
karthikeyan Chockalingam
Ranch Hand
Posts: 259
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apply style Cascading Style Sheets (CSS) to the select box
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64708
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
sreejith panampilly
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok sorry Bear Bibeault
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic