Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6898717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:19:54+00:00 2026-05-27T07:19:54+00:00

I have a select list inside a dialog box: <div id=’Dialog’ title=’Title’> <div id=’list_container’>

  • 0

I have a select list inside a dialog box:

<div id='Dialog' title='Title'>
    <div id='list_container'>
        <select id='file_list' multiple='multiple'>
        </select>
    </div>
</div>

I’m populating file_list in javascript. The css for list_container and ‘file_list` look like this:

#list_container {
    width: auto;
    height: auto;
    overflow: auto;
    border: 1px black solid;
    margin: auto;
}

#file_list {
    border: none;
}

The file_list opens inside a dialog box and typically has many options(>20). When the dialog box pops up, the list shows about 10 entries and I can scroll down to other entries. However, I want the list to expand vertically when I resize the dialog box vertically (i.e. the list should show more than 10 entries depending on the vertical space available in the dialog box). How can I do this? I tried doing a few things like setting the height css attribute for file_list to auto , but it doesn’t seem to work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T07:19:54+00:00Added an answer on May 27, 2026 at 7:19 am

    This is similar to the answer provided by SOliver. I solved it by firing a function at the dialog resize event, and modifying the size attribute of the select-list depending on the height of the dialog box:

    $('#Dialog').dialog({
      height: 460,
      width: 500,
      //Add a function on the dialog resize event
      resize: function(event, ui) {
        var default_height = 460;     //default height 
        var new_height = ui.size.height; //Gives height after resize
          if (new_height > default_height) {
            var list = $('#file_list');
            var row_height = ((flist.height())/(flist.attr('size'))); 
                                 //Get height of one row
            var extra_space = new_height-default_height;
            var list_newSize = Math.floor(extra_space/row_height) + 11; 
                                //11 is the default or minimum 'size' of file_list
            flist.attr('size',list_newSize);
          }
      }
    );
    

    Make sure you set the height and width of the div that contains select list to auto. Now the size of the list should scale with the size of the dialog box.

    Though this works, it seems like an ad-hoc solution. Any there any more elegant ways to do this?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a html form which have a select list box from which you
I have a multi-select list box. I want to be able to select a
I have a table with multiple rows in each row is a select list
I have a select list like the following inside of a form. <select name=0[voicemail]
I have a list of option inside select list, also I have textfield that
I have a select list which is being populated using the values from a
I have a select list I've created in a form alter, however, when I
I have a situation where the second select list option is generated from the
I have a routine that dynamically changes a select list's selected option when the
I have written a simple CRUD form which has one select list. However the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.