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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T21:47:55+00:00 2026-05-20T21:47:55+00:00

I have code that acts properly in FF, Safari and Chrome, however the result

  • 0

I have code that acts properly in FF, Safari and Chrome, however the result is reversed in IE. I am displaying a yes/no radio button question, then based on the selection I show the ‘yes followups’ or the ‘no followups’.
‘position_1’ are the elements to show if the first radio button option is selected…

#My onclick js


function ShowHide(parent, position_1, position_2) {
    if (parent[0].checked) 
        {
            ShowIt(position_1); 
            HideIt(position_2);
        }
    else
        {
            if (parent[1].checked)
                {
                    HideIt(position_1);
                    ShowIt(position_2);}    
                else {}
        }       
}
#Additional JS
function ShowIt(childs) {
    //show it
    for (i=0;i<childs.length;i++) {
        jQuery("#"+childs[i]).css('margin-left','50px').css('background-color','#F2F2F2').slideDown();
    }
}
function HideIt(childs) {
    //hide it
    for (i=0;i<childs.length;i++) {
        jQuery("#"+childs[i]).slideUp();
    }
}

The above code works in FF, Chrome, and Safari as stated. However in IE with the above code it does the opposite. For instance if what I perceive as ‘position_1’, or first from left, is selected it shows the child inputs for ‘position_2’ and vice versa.
If I switch up the positions like so…

function ShowHide(parent, position_1, position_2) {
    if (parent[0].checked) 
        {
            ShowIt(position_2); 
            HideIt(position_1);
        }
    else
        {
            if (parent[1].checked)
                {
                    HideIt(position_2);
                    ShowIt(position_1);}    
                else {}
        }       
}

IE works and then FF, Chrome, and Safari are reversed. It appears that my ordering for the radio options is opposite for IE. Is there a better way to do this that will work across all browsers?

UPDATE

HTML Snippet (FYI I an using django package uni-form to show form)

<div id="div_id_question_181" class="ctrlHolder">
                    <label for="id_question_181">                    
                Is the Dog Friendly?*
            </label>
        <label for="id_question_181_0"><input name="question_181" onchange="ShowHide(question_181,new Array(&#39;div_id_question_220&#39;),new Array());" type="radio" class="radioselect" value="1" id="id_question_181_0" /> Yes</label> <label for="id_question_181_1"><input name="question_181" onchange="ShowHide(question_181,new Array(&#39;div_id_question_220&#39;),new Array());" type="radio" class="radioselect" value="0" id="id_question_181_1" /> No</label> 
   </div>
   <div id="div_id_question_220" class="ctrlHolder">
            <label for="id_question_220">                    
                Did you pet it?
            </label>
        <label for="id_question_220_0"><input value="1" type="radio" class="secondary_field triggeron_181 choice_0 radioselect" name="question_220" id="id_question_220_0" /> Yes</label> <label for="id_question_220_1"><input value="0" type="radio" class="secondary_field triggeron_181 choice_0 radioselect" name="question_220" id="id_question_220_1" /> No</label> 
   </div>
  • 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-20T21:47:55+00:00Added an answer on May 20, 2026 at 9:47 pm

    I found a solution Here that works and in an effort to tie up loose ends here’s what I did. The only thing that I changed, is I edited the ShowHide function like so.

    function ShowHide(parent, position_1, position_2) {
    var radioLength = parent.length;
    for(var i = 0; i < radioLength; i++) {
        if(parent[i].checked) {
            var radio_value = parent[i].value;
        }
    }
    if (radio_value == 0) 
        {
            ShowIt(position_1); 
            HideIt(position_2);
        }
    else
        {
            if (radio_value == 1)
                {
                    HideIt(position_1);
                    ShowIt(position_2);}    
                else {}
        }       
    

    }

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

Sidebar

Related Questions

I have some code that acts as a click toggle for a menu. I
I have to write a simple piece of code that acts on a file;
I have some image processing Java code in Android that acts upon two large
I have the following section of code that acts on values in <Test></Test> nodes
I have some Javascript code that acts on an pixel array defined like so:
I have a jQuery UI progressbar that acts as a timer. However when I
I have code that generates a List<string[]> variable but can't quite figure out how
I have code that looks more or less like the code below but it
I have code that sends web requests through two parallel for each loops. Will
I have code that reloads images via HTTP from the main thread and displays

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.