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 178503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:14:33+00:00 2026-05-11T14:14:33+00:00

I have three select boxes. <div style=’float: left; padding-right: 10px;’> <select size=10 name=company_id> //

  • 0

I have three select boxes.

<div style='float: left; padding-right: 10px;'>     <select size='10' name='company_id'>         // a lot of options here     </select> </div>  <div style='float: left; padding-right: 10px;'>     <select size='10' name='department_id' id='department_id'>         // a lot of options here     </select> </div>  <div style='float: left; padding-right: 10px;'>     <select size='10' name='user_id[]' id='user_id' multiple>         // a lot of options here     </select> </div> 

They are floated next to each other. When you select an item in the 1st one, an ajax query updates the values of the 2nd one.

What happens in Firefox and most other browsers is that it changes in size and pushes the 3rd one away. But in IE (6.0 and 7) the 2nd one changes size but it does not push the 3rd one away.

What i had done is to fix the size of the boxes but i want to fix this correctly, so anyone know how?

Here’s the JQuery code i use to add the data to the departments select.

$.get('ajax/fetchDepartment.php?sec=departments&company_id='+company_id,     function(data){         $('#department_id').html(data); }); 

data contains the <option>Stuff</option>‘s needed

EDIT to add: The select boxes always have some value within them.

Here’s a picture of what happens (i had to remove the items in the boxes via photoshop but you get my point)

selcet bug http://cznp.com/select_bug.jpg

  • 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. 2026-05-11T14:14:33+00:00Added an answer on May 11, 2026 at 2:14 pm

    IE and select options have certain ‘quirks’ (some, regarding select boxes and innerHTML are detailed here) about them that I’ve never really fully understood, but I can at least provide you with a workaround. The trick is to add the options exlicitly to the select box, not just change the entire html of the select element wholesale. So the following works:

    function changeval() {      var option = document.createElement('option');     option.text = 'my long text value to change stuff';     option.value = 'test';     $('#department_id')[0].options.add(option); } 

    While this does not:

    function changeval() {     var data = '<option value='test'>my long test string with wide stuff</option>';     $('#department_id').html(data);  } 

    You might find this page helpful -apparently he fixed it by just retouching the innerHTML, so that might be a simpler option. Up to you.

    The solution from the second link would look like:

    function changeval() {     var data = '<option value='test'>my long test string with wide stuff</option>';     $('#department_id').html(data);     $('#department_id').parent()[0].innerHTML += ''; } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form with a select box and three text input boxes. When
I have a form with 3 combo boxes. The value of the combo boxes
I have three tables, one listing contacts, the other users, and the last emails.
I have three tables: Product ProductID ProductName 1 Cycle 2 Scooter 3 Car Customer
I have three tables like this CREATE TABLE `money`.`categories` ( `ID` bigint(20) unsigned NOT
I have a query like this: select author1 from books_group where category='cse' union select
I have three files; index.php, searchbar.php and search.php now when i have search.php show
I created three tables in SQL Server 2008, all with Code char(1) not null,
I need to write an application in VB6 which makes a scatter plot out
Edit 4: I was finally able to solve my own issue. See checkmark answer

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.