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

Ask A Question

Stats

  • Questions 122k
  • Answers 122k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Put the function below this one into a public module.… May 12, 2026 at 12:52 am
  • Editorial Team
    Editorial Team added an answer If variables are needed only for a single run of… May 12, 2026 at 12:52 am
  • Editorial Team
    Editorial Team added an answer One thing many people have a problem with is they… May 12, 2026 at 12:52 am

Related Questions

I have three select boxes. <div style='float: left; padding-right: 10px;'> <select size=10 name=company_id> //
I am sure sure if this is even possible due to the nature of
By default Html.ValidationSummary() produces HTML like this: <span class=validation-summary-errors>There were some errors...</span> <ul class=validation-summary-errors>
I am looking to grab the value of a form input. I think my
I have this bit of script to widen a text box on mouseover and

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.