Results 1 to 5 of 5

Thread: Expanding select box inside form

  1. #1
    Join Date
    Sep 2008
    Posts
    48
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Default Expanding select box inside form

    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!

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    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.

  3. #3
    Join Date
    Sep 2008
    Posts
    48
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Default IE6 issue

    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!

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:

    Code:
    <div style="width: 100px;overflow: auto;">
    <select>
    <option . . .
    </select>
    </div>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Sep 2008
    Posts
    48
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Default

    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!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •