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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:47:19+00:00 2026-05-22T16:47:19+00:00

The routine below works perfectly in Mozilla, but not in IE (I’m using 9

  • 0

The routine below works perfectly in Mozilla, but not in IE (I’m using 9 but have changed the compatibility mode and it’s broken in 7 and 8 too).

I know that it’s something to do with the e.type as ‘undefined’ in IE, and fine in Moz, but don’t know what the correct syntax should be to satisfy both.

function changeChartColumns(){
        var myArray = [];
        var k = 1;
        var b = 0;
        myArray[0]=0;
        for (b in document.frm_obj.elements) {
            var e = document.frm_obj.elements[b];
            if ( e.type=="checkbox" ) {
                if(e.checked == true){
                    var at_least_one_checked = true;
                    myArray[k] = parseInt(e.value,10);
                    k = k+1;
                }
            }
        }
        if(at_least_one_checked == true){
            return myArray;
        }else{
            alert("I cannot display zero information. Please select some stuff using the checkboxes.");
            stop_script_running; // horrible hack
        }
}

Here’s the HTML:

<form name="frm_obj" id="frm_obj" method="post">
      <table>   
        <tr>
         <td><input type="checkbox" name="list" value="2" checked onClick="changeChartColumns();"></td>
         <td>Option 1</td>
         <td><input type="checkbox" name="list" value="3" checked onClick="changeChartColumns();"></td>
         <td>Option 2</td>
         <td><input type="checkbox" name="list" value="4" checked onClick="changeChartColumns();"></td>

       </table>
     </form>

Thanks in advance. H.

  • 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-22T16:47:20+00:00Added an answer on May 22, 2026 at 4:47 pm

    Use a proper for loop:

        for (var i=0; i < document.frm_obj.elements.length; i++) {
    

    Working demo: http://jsfiddle.net/y7xFz/1

    for...in is designed to iterate over all enumerable properties of an object. document.frm_obj.elements returns a HTMLCollection, whose enumerable properties differ between browsers. In general, you shouldn’t use for...in on arrays and HTMLCollections – reserve use for object maps with named properties only.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having a problem using the signedCMS.decode routine. See the code below. The
My new ASP.NET MVC Web Application works on my development workstation, but does not
The code below works for Delphi XE, but the 2400 buffersize is pretty ugly.
I have this ajax call, which works for the most part, but it does
The routine below inserts a page, sets permalinks to postname then attempts to update
The routine below does two scans over an input stream of hypertext. The first
I have a routine which is updating my business entity. The update involves about
I was using this routine, triggered by the Worksheet_Change event, to display a selected
I have a routine that examines thousands of records looking for discrepancies. This can
I use a routine that can start and stop services via Delphi 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.