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

  • Home
  • SEARCH
  • 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 768395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:10:28+00:00 2026-05-14T18:10:28+00:00

In my HTML page I have 2 select menus with IDs month and day

  • 0

In my HTML page I have 2 select menus with IDs “month” and “day” – “day” is empty when the page loads, “month” has 12 options with values 1-12 corresponding to January – December.

“month” has an onchange event which calls this function:

function showOutboundDays(month)
{
if(month==4 || month==6 || month==9 || month==11)
    document.getElementById('day').innerHTML='<option value="1">1</option><option value="2">2</option>'; etc. up to 30
else if(month==2)
    document.getElementById('day').innerHTML='<option value="1">1</option>'; etc. up to 28
else 
    document.getElementById('day').innerHTML='<option value="1">1</option>'; etc. up to 31
}

(just imagine there are braces around the option tags to help you see…)

I think it’s pretty clear to see what I’m trying to achieve…and everything works fine apart from the innerHTML of the select with ID “day” doesn’t get filled at all, regardless of what month you pick. And I know the problem is with this stage of the function because when I change the if, elseif and else code-to-be-executed to alerts or something similar, it works fine.

Does anybody know what the problem with the innerHTML is?

Thanks

EDIT: Using Firefox 3.6

  • 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-14T18:10:29+00:00Added an answer on May 14, 2026 at 6:10 pm

    This is a known issue for IE.

    KB article with workaround:
    http://support.microsoft.com/kb/276228

    Also: dupe of:
    innerHTML replace does not reflect

    EDIT: Here is my working sample based on your code:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
     <title>Selects</title>
     <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
     <style rel="stylesheet" type="text/css">
     </style>
     <script>
    function showOutboundDays(month) 
    { 
        if(month==4 || month==6 || month==9 || month==11) 
            document.getElementById('day').innerHTML='<option value="1">1</option><option value="2">2</option>';
        else if(month==2) 
            document.getElementById('day').innerHTML='<option value="1">3</option><option value="1">4</option>';
        else  
            document.getElementById('day').innerHTML='<option value="1">5</option><option value="1">6</option>';
    }
     </script>
     </head>
    <body>
        <select onchange="showOutboundDays(this.value);">
            <option value="1">January</option>
            <option value="2">February</option>
            <option value="3">March</option>
            <option value="4">April</option>
            <option value="5">May</option>
            <option value="6">June</option>
            <option value="7">July</option>
            <option value="8">August</option>
            <option value="9">September</option>
            <option value="10">October</option>
            <option value="11">November</option>
            <option value="12">December</option>
        </select>
        <br />
        <select id="day">
        </select>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have n number of select elements in an html page that are used
in my html page, I have the following: <div id=rub> Select at least one
I have a select dropdownlist with 1 item selected at page load in html.
I have a page that loads an external HTML page into an iFrame. There
Currently I have my chained select menus working great. However currently when the page
I have a JQuery Mobile app. This app has a page with a select
I have a page with a ScriptManager, a generic HTML drop-down list ( <select>
in my html page I have div with css: padding: 0px; color: rgb(51, 51,
Suppose on my HTML page I have many href s to a link. Using
In a simple html page I have: <SCRIPT> function Clicker(number){ if (number == 1)

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.