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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:23:37+00:00 2026-05-29T15:23:37+00:00

With this script I fill the dropdownbox dynamicly: function loadDropbox(boxName,checkBox,selected){ var htmlStr=; var searchXML

  • 0

With this script I fill the dropdownbox dynamicly:

function loadDropbox(boxName,checkBox,selected){
    var htmlStr="";
    var searchXML = new ActiveXObject("Msxml2.DOMDocument");
    searchXML = getXML("WEBDRPO0;?BDR="+bdr+"&TYPE_ART=D");
    var nodeList = xmlDoc1.documentElement.selectNodes("//box[@name='"+boxName+"']");
        try{
    for(i=0;i<nodeList.length;i++){
    var vals = ""+nodeList[i].firstChild.nodeValue+"";
    vals = vals.split("~");
    for(i=0;i<vals.length;i++){
    if(checkBox=='1'){
        htmlStr+="<br /><label><input type=checkbox name='aanwezigheid' id='aanwezigheid' value="+vals[i]+" id="+vals[i]+"/>"+vals[i]+"</label><br/>";
    }else if(selected == vals[i]){
        htmlStr+="<option selected='selected'>"+vals[i]+"</option>";
    }else{
        htmlStr+="<option>"+vals[i]+"</option>";
                }
            }
        }
    }   
    catch(e){}
    return htmlStr;
}

This is the HTML result:

<select id="year" name="year">
  <option>--Make Choice--</option>
  <option>1980 - 1990</option>
  <option>1990 - 2000</option>
  <option>2000 - 2010</option>
  <option>2010 - later</option>
</select>

With this Javascript I would make the “2010 – later” value the seleceted value.

<script language="javascript" type="text/javascript">
document.getElementById("year").value = "2010 - later";
</script>

It works fine in Firefox, but it don’t work in IE9.
What am I doing wrong?

Regards,

Freexel

  • 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-29T15:23:39+00:00Added an answer on May 29, 2026 at 3:23 pm

    You should set value attribute for the option.

    Eg:

    <option value="2010 - later">2010 - later</option>
    

    Update:
    According your code, it should be:

    htmlStr+='<option value="'+vals[i]+'" selected="selected">'+vals[i]+'</option>';
    

    And

    htmlStr+='<option value="'+vals[i]+'">'+vals[i]+'</option>';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So i have this code: <html> <head> <title>Form</title> <script type=text/javascript> function showConfirmationDialog() { var
I've got this script on my website : $(document).ready(function() { function filterPath(string) { return
I found this script: <script language=Javascript TYPE=text/javascript> var container = document.getElementById('dl'); var seconds =
I want to make this script to work as LIVE() function. Please help me!
I add this script in jsp file. This function always returns true even for
Here is my script: <script> Raphael.fn.polyline = function(pointString) { return this.path(M + pointString); };
I've seen this approached with a php script to fill the autocomplete..and didn't quite
For this script, it checks to see if the file is a microsoft words
I have this script: select name,create_date,modify_date from sys.procedures order by modify_date desc I can
I'm using this script to display all the images in a folder, but I

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.