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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T11:38:50+00:00 2026-06-18T11:38:50+00:00

Function: function disable_hidden_flip_questions(option, value){ var first_q = document.getElementById(‘hidden_auto_questions’); var second_q = document.getElementById(‘hidden_include_auto’); var inputs_list

  • 0

Function:

function disable_hidden_flip_questions(option, value){
    var first_q = document.getElementById('hidden_auto_questions');
    var second_q = document.getElementById('hidden_include_auto');
    var inputs_list = [];
    if(option == 'all'){
        inputs_list.push(first_q.getElementsByTagName("input"));
        inputs_list.push(second_q.getElementsByTagName("input"));
    }else if (option == 'first'){
        inputs_list.push(first_q.getElementsByTagName("input"));
    }else if(option == 'second'){
        inputs_list.push(second_q.getElementsByTagName("input"));
    }

    for (var inputs in inputs_list){
        for(var input in inputs_list[inputs]){
            if(inputs_list[inputs].hasOwnProperty(input) && input != 'length'){
                if(!value){
                    inputs_list[inputs][input].removeAttribute('disabled');
                }else{
                    inputs_list[inputs][input].setAttribute("disabled", "disabled");
                }
            }
        }
    }
}

Works perfectly fine in Chrome and Firefox, but in IE9 the console gives me an error on this line:

inputs_list[inputs][input].setAttribute("disabled", "disabled")

If I console.log(inputs_list[inputs][input]) I get this in Chrome:

(The input is being generated by RoR, which is why its name and id are so long)

<input class="radio_buttons optional" id="custom_attributes_trailer_insurance_endorsement_false" name="custom_attributes[trailer_insurance_endorsement]" type="radio" value="false" disabled="disabled"> 

Yay, that’s what I wanted (and expected)… But in IE9’s console I get this:

[object HTMLCollection]

Which is completely useless….

So question: Where am I going wrong in IE’s exalted view? I know IE9 supports setAttribute, so I am assuming it has to do with my for...in loops.

Edit: So due to comments, the problem could be with the object types (HTMLCollection being stored in an Array) . If that is indeed the case, how do I go about making everything compatible data types?

  • 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-06-18T11:38:51+00:00Added an answer on June 18, 2026 at 11:38 am

    Solution in jquery:

      $("input[name=trailer_use]").click(function(event){
            if(event.target.id == "trailer_use_yes"){
                $("#hidden_auto_questions").removeClass('hide_auto').addClass('show_auto');
                $("input[name=trailer_insured]").removeAttr("disabled");
                show_trailer_warning(null, "remove");
            }else {
                $("#hidden_auto_questions").removeClass('show_auto').addClass('hide_auto');
                $("input[name=trailer_insured]").attr("disabled", "disabled");
                if($("#hidden_include_auto").hasClass("show_auto")){
                    $("#hidden_include_auto").removeClass('show_auto').addClass('hide_auto');
                    $('input[name="custom_attributes[trailer_insurance_endorsement]"]').attr("disabled", "disabled");
                }
                show_trailer_warning(null, "disclaimer");
            }
      });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here it is: //Disable KeyboardNavigation document.getElementById(author).onfocus = function() { document.onkeyup = null; }; document.getElementById(email).onfocus
$('#loginForm').submit(function() { $(#loginsubmit,this).attr(disabled,disabled); var u = $(#loginemail, this).val(); var p = $(#loginpassword, this).val(); var
This code disabled mouse scroll functionality, when i click on the document. $(document).on(click, function
I've got libraries that do no expose any function except say CreateObject. Nevertheless all
How can I prevent this function from calling itself again: $(document).ready(function() { login(); });
jQuery(document).ready(function(){ /* for top navigation */ jQuery(#menu ul, #menu li).css(-webkit-transform, translateZ(0)); jQuery( #menu ul
I'm using the following script to disable cut and paste on my form: $(document).ready(function(){
I wanted to know the way to disable a function from usage in PHP.
I am trying to write a function that will: Disable the submit button when
This function works fine if I disable errors. But I have to solve them.

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.