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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:50:49+00:00 2026-05-10T22:50:49+00:00

the following js works fine in FF2 but in IE6 the dropdown always selects

  • 0

the following js works fine in FF2 but in IE6 the dropdown always selects one option to early, IE -> testix2 vs. FF2 -> testix3 If we add an alertBox somewhere in the script, it also works fine in IE6. But how to solve this without an alertBox?

tia

<script language='JavaScript' type='text/javascript'> <!-- function Entry(value, name, selected) {     this.value = value;     this.name = name;     this.selected = selected; }   //--> </script>         <select id='selSeaShells'>          </select> <script language='JavaScript' type='text/javascript'> <!-- var productCategoryLevel2 = new Array();  productCategoryLevel2.push(new Entry('Hallo1', 'testix1', false)); productCategoryLevel2.push(new Entry('Hallo2', 'testix2', false)); productCategoryLevel2.push(new Entry('Hallo3', 'testix3', true));      var i = 0;         for (i in productCategoryLevel2) {         var optL2 = document.createElement('option');         optL2.selected = true;                  optL2.text = productCategoryLevel2[i].name;         optL2.value = productCategoryLevel2[i].value;         if (productCategoryLevel2[i].selected == true) {             productCategoryLevel2[i].selected = true;             optL2.selected = true;         } else {             optL2.selected = false;              }                 try {             document.getElementById('selSeaShells').add(optL2, null);                 } catch(ex3) {             document.getElementById('selSeaShells').add(optL2);                 }         } //--> </script> 
  • 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-10T22:50:49+00:00Added an answer on May 10, 2026 at 10:50 pm

    I’m not entirely sure why your example does not work, but it works if you do it like this (i.e. setting the selectedIndex on the <select> rather than setting the <option>’s selected propery). Tested FF3, IE6, Chrome.

    var i = 0; for (i in productCategoryLevel2) {     var optL2 = document.createElement('option');      optL2.text = productCategoryLevel2[i].name;     optL2.value = productCategoryLevel2[i].value;     try {         document.getElementById('selSeaShells').add(optL2, null);     } catch(ex3) {             document.getElementById('selSeaShells').add(optL2);     }      if (productCategoryLevel2[i].selected == true) {             document.getElementById('selSeaShells').selectedIndex = i;     }       } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 62k
  • Answers 62k
  • 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
  • added an answer You write tests which specify the behaviour of the top-level… May 11, 2026 at 10:12 am
  • added an answer The factory pattern May 11, 2026 at 10:12 am
  • added an answer Defines a date that is combined with a time of… May 11, 2026 at 10:12 am

Related Questions

the following js works fine in FF2 but in IE6 the dropdown always selects
I have the following HTML / JS: <html> <body> <script> function foo(){ var html
I have some JS code which generates the following object, return { type: some
I'm using the following code to have a non-JS navigation: <ol id=navigation> <li id=home><a
I use the following for a jQuery link in my <script> tags: http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js Is
I have the following file file: <html> <head> <title></title> <script type=text/javascript src=/Prototype.js></script> <script type=text/javascript>
What I'd like to do is produce an HTML/CSS/JS version of the following. The
I have Designed the Javascript function My.js it contains following code My.js function display(){
The following shell script takes a list of arguments, turns Unix paths into WINE/Windows
The following C++ code uses a ifstream object to read integers from a text

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.