75 users online (1 members and 74 guests)  

Thread: LISTBOX Width


  Results 1 to 6 of 6

Related

  1. fixing the width of <td>    Forum: HTML Forum
    Replies: 2
  2. CSS Selector Width    Forum: CSS Forum
    Replies: 0
  3. Help me about Dropdown ListBox    Forum: HTML Forum
    Replies: 1
  4. Onclick Listbox    Forum: Javascript Forum
    Replies: 2
  5. CSS and img height & width    Forum: CSS Forum
    Replies: 1
  1. #1
    sbarrow's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2002
    Posts
    3

    LISTBOX Width

    Is there anyway of stopping a listbox control from automatically resizing when an options text length is greater than the set width or the contol?

    Thanks.




  2. #2
    Doorknob's Avatar
    Super Newbie

    Status
    Offline
    Join Date
    Jun 2002
    Location
    Malaysia
    Posts
    316

    RE

    try this. got it from google newsgroups

    >I don't believe you can guarantee these widths , but when I >need a listbox to be of a particular width , I render it with >but a single item, that makes the Width what I want, then >use an onload even to call a javascript function to load the >listbox with the other items.

    >It is best to open a seperate non-resizable window to >display the material , as once a window is resized , so too >will the width of the listbox.

    >Again this may not work for all browsers.

  3. #3
    sbarrow's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2002
    Posts
    3
    I am using javascript to build the listbox and it still resizes.

  4. #4
    Doorknob's Avatar
    Super Newbie

    Status
    Offline
    Join Date
    Jun 2002
    Location
    Malaysia
    Posts
    316

    RE

    dont think there's any way to set a certain length. maybe u can try changing the font size and/or font face of the listbox to keep it within a certain size

  5. #5
    sbarrow's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2002
    Posts
    3
    I have found an answer I used style = "width:=400px" in the declaration and it works. Now I have to work out how to display the text that has been cut off by this process.

  6. #6
    Doorknob's Avatar
    Super Newbie

    Status
    Offline
    Join Date
    Jun 2002
    Location
    Malaysia
    Posts
    316

    RE

    if it's too long then just add <br> in the <option>



Tags for this Thread