Forum Moderators: open

Message Too Old, No Replies

<select>

Setting a height to avoid scroll!?

         

Alternative Future

9:24 am on Jun 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi all,

Is it possible to set a height to the select tag to avoid it scrolling? We have a select tag with several options within it, when viewing this on one machine with 1024x768 resolution and WinXP OS it displays fine no scroll and IE6, but, on the tester’s machine again running same settings and OS as above it has a scroll bar. Both machines make the available selection go upwards on the screen, therefore plenty real estate to avoid the need for the scroll. What we would like to do if it is possible is set a height within the select to avoid this happening, is this possible?
Obviously setting the size is not acceptable as this displays what ever size specified, and uses more real estate on the screen.
Has anyone ever seen this behavior before?
This requirement only needs to work in IE!

-George

BlobFisk

9:49 am on Jun 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can you access the number of options being rendered (ie: is this being done by some server side code?).

If so why not use size= and programatically work out the value to assign to size based on the number option <option>s being written?

The other alternative would be to use so JS to workout the number of options in the select and assign the size (or CSS height) based on that. This method would be less streamlined than the server side option.

Obviously you need to use a multiple select to acheive this...

HTH

Alternative Future

10:20 am on Jun 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



HI BlobFisk,

>>Can you access the number of options being rendered (ie: is this being done by some server side code?).
Yes we can access the number of options being rendered through server-side script.

>>If so why not use size=
>>Obviously you need to use a multiple select to acheive this...
Multiple select is not really an option:
a) only one event should happen on the select, either edit, copy or make an audit on the current page along with others.
b) this would use more real estate on the page which is not available.

Thanks for the reply, I can now safely say that there is no way on making the current select larger without making some of the changes you have suggested.

Thanks,

-George

BlobFisk

10:29 am on Jun 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Also if you don't use a multiple select list, using CSS to increase the height will only increase the height of the box which will still only display 1 option value.

If there are only 2 or 3 options which are calls to action, maybe using a button may be a more usable solution?

Alternative Future

10:38 am on Jun 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>>Also if you don't use a multiple select list, using CSS to increase the height will only increase the height of the box which will still only display 1 option value.
Yeah I tried running some dummy tests to see the outcome on this idea :(

>>If there are only 2 or 3 options which are calls to action, maybe using a button may be a more usable solution?
Afraid there is several on some instances of the application I only listed two or three to give an idea of the intention behind its function.

Again thanks BlobFisk, you are helping me confirm my findings and suggesting some I never thought of, your help is really appreciated :)

-George

DrDoc

2:56 pm on Jun 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Single select, all options visible...
I think that's best described with radio buttons ;)