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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:27:26+00:00 2026-06-18T16:27:26+00:00

here are two jquery codes code 1 $(document).ready(function() { $(div.imgDisp).hide(); $(‘[id=’ + $(:radio:checked).val()+’]’).show(); $(:radio).click(function()

  • 0

here are two jquery codes

code 1

$(document).ready(function() { 
    $("div.imgDisp").hide();
    $('[id="' + $(":radio:checked").val()+'"]').show();
    $(":radio").click(function() {      
        $("div.imgDisp").fadeOut('slow');
        $('[id="' + $(this).val()+'"]').fadeIn('slow');
    });
});

This code hides the divs on selecting a radio button
check this fiddle http://jsfiddle.net/nanoquantumtech/qudT2/3/

in this fiddle you can see a set of radios under name = “type”. All works well till here..

there are other set of radio buttons as well under different names.. now the problem is that when i click any of those radio buttons under diffrent names, and although they are not related anyway to this fiddle code clicking them nullify the effect of this fiddle and the desired effect of this fiddle just vanishes.
i.e. if i click on any other radio button other then those shown in fiddle, they make the displayed result hide, while the result in fiddle shall stay on screen. I m surprised..

same problem is with another jquery code i have used to show/hide a textfiled.. [I M OMITTING ANOTHER CODE CUZ THE PROBLEM IS SAME WITH THAT CODE ALSO]

what could be wrong guys? thanks in advance..

  • 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-18T16:27:28+00:00Added an answer on June 18, 2026 at 4:27 pm

    problem here is you are calling click event for all radio i.e $(":radio").click(function() { .. specify thhe click event to those radios only whose name="type"..

    $('input[name="type"]:radio').click(function() {.... });
    

    try this

    $('input[name="type"]:radio').click(function() {
        $("div.imgDisp").fadeOut('slow');
        $('[id="' + $(this).val()+'"]').fadeIn('slow');
    });    
    

    this will only call the click event for input whose name=”type” and radio .

    fiddle here

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

Sidebar

Related Questions

so basically here is my script: http://jsfiddle.net/JJFap/42/ Code - jQuery(document).ready(function() { var rel =
I have a problem with click event; here's the code: jQuery: $(document).ready(function() { $('.myClass').click(function()
i recently came across this script: <script src=http://code.jquery.com/jquery-latest.js></script> <script> $(document).ready(function(){ $(#showdiv).click(function(){ $(.dropdowndiv).slideDown(500); }); $(#hide).click(function(){
I have the following JQuery code: jQuery(document).ready(function($) { var retrievedList = [ { id
jQuery-newbie here. I want to do a simple horizontal scroll function with two buttons.
right now , I use jQUery(document).ready to inject javascript into a div. All is
I am having two radiobuttons, <div class=class1> <span><input name=chk1 type=radio checked=checked id=check1/>Option 1</span> <span><input
Here I am trying to implement the jQuery I have two main files one
Here is my current setup. I have two pages running on the jquery mobile
I copied a pice of jquery code from a tutorial for working with radio

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.