View Full Version : Expanding select box inside form
the penguin
12-05-2008, 03:34 PM
Hello,
I'm trying to build a drop down list inside a form. I have that working but how do i control the width of the option select section. If someone could point me in the right direction, i would highly appreciate it.
The issue i'm having is that some of the links are too long that it expands the intial box too much.
Thanks!
boogyman
12-05-2008, 03:40 PM
Contracting the width of a select box is a tricky situation, and generally not very good practice, however to accomplish this, one could explicitly set the width of the select and/or option tags, which would provide a horizontal scroll bar.
The better option would be to reduce the size of the values, thus reducing the overall width.
the penguin
12-05-2008, 04:18 PM
Thank you for the quick response.
I'm testing this method now. It works in FF but not in IE6 (big surprise), lol.
I'll keep playing and hopefully find a fix. Unless you know of one.
Thanks!
jscheuer1
12-05-2008, 04:31 PM
Form elements are tricky, generally each browser has some quirk about each one of them as far as what styles and attributes will actually work with each of them. You could try putting it in a container division of the desired width that has overflow auto:
<div style="width: 100px;overflow: auto;">
<select>
<option . . .
</select>
</div>
the penguin
12-05-2008, 04:58 PM
Once again,
Thank you for the quick response, I tried that method as well, no luck :(.
I've seen this done before, but with the use of javascript that was a bit beyond my scope.
Thanks for all the help so far!
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.