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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:55:20+00:00 2026-06-14T21:55:20+00:00

Hi all i am working on jquery here i have three three radio buttons

  • 0

Hi all i am working on jquery here i have three three radio buttons and i have three div for each selection i need to select
one dive like i had providing separate div for it when i selected the div it wil open right ok i need to perform like when
i selected the other radio button the other one which opened first should close and selected should open how could i do this
this is my code follows please help me to do this

                         <form class="form-horizontal" id="zone"> 
                           <label class="control-label" for="Availability">Shipping Zone Type</label>
                <div class="controls">
                <label class="radio">
                    <input type="radio" class="regular-radio" name="radio-1-set" id="radio-1-1"><label for="radio-1-1"></label>
                    This shipping zone is based on one more countries
                    <span class="tooltip-demo"><a data-original-title="Tooltip on right" href="#" rel="tooltip" data-placement="right"><i class="icon-question-sign"></i> </a></span>

                </label>

                <div class="selectbox-bg selectbox-bg-sb3 pull-left " id="shippingZone" style="display:none">
               <select>
                  <option>Choose a Country</option>
                  <option>2</option>
                  <option>3</option>
                  <option>4</option>
                  <option>5</option>
               </select>
               </div> 
                           <label class="radio">
                    <input type="radio" class="regular-radio" name="radio-1-set" id="radio-1-2"><label for="radio-1-2"></label>                     
                    This shipping zone is based on one more state or provinces
                    <span class="tooltip-demo"><a data-original-title="Tooltip on right" href="#" rel="tooltip" data-placement="right"><i class="icon-question-sign"></i> </a></span>
                 </label>
                   <div class="selectbox-bg selectbox-bg-sb3 pull-left " id="shippingzonecountry" style="display:none">
               <select>
                  <option>Choose a Country</option>
                  <option>2</option>
                  <option>3</option>
                  <option>4</option>
                  <option>5</option>
               </select>
               </div>
                  <input type="radio" class="regular-radio" name="radio-1-set" id="radio-1-3"><label for="radio-1-3"></label>                    
                 This shipping zone is based on one more postal or ZIP codes
                        <span class="tooltip-demo"><a data-original-title="Tooltip on right" href="#" rel="tooltip" data-placement="right"><i class="icon-question-sign"></i> </a></span>
                </label>
                <div class="selectbox-bg selectbox-bg-sb3 pull-left " id="zipcode" style="display:none">
               <select>
                  <option>Choose a Country</option>
                  <option>2</option>
                  <option>3</option>
                  <option>4</option>
                  <option>5</option>
               </select>
               </div>  
                         </form>  

in the above i have three radio bttons and three divs i need to select a radio button and it shoul b open
when i select the other the first which is opened it should be close plz help me to this sdtha

          thi is my jquery :as fpllows

                $(function () {
                 $("#radio-1-2").click(function () {
           $("#shippingzonestate").show('slow');
             });

          $("#radio-1-2").click(function () {
          $("#shippingzonestate").show('slow');
          $("#shippingzonecountry").show('slow');
           });

          $("#radio-1-3").click(function () {
         $("#zipcode").show('slow');
          $("#Product-Code-SKU").show('slow');
           });

i had tried like this but when i opened the other one should close how could i do this

  • 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-14T21:55:21+00:00Added an answer on June 14, 2026 at 9:55 pm

    EDIT(Common function)

    function showhide(radioname)
    {
        $("#shippingzonestate").hide('slow');
        $("#shippingzonecountry").hide('slow');
        $("#zipcode").hide('slow');
        $("#Product-Code-SKU").hide('slow');
    
       if(radioname=="one")
       {
         $("#shippingzonestate").show('slow');
       }
       if(radioname=="two")
       {
         $("#shippingzonestate").show('slow');
         $("#shippingzonecountry").show('slow');
       }
       if(radioname=="three")
       {
         $("#zipcode").show('slow');
         $("#Product-Code-SKU").show('slow');
       }
    }
    
    
    $(function () {
                     $("#radio-1-2").click(function () {
                           showhide("one");
                 });
    
              $("#radio-1-2").click(function () {
                            showhide("two");
               });
    
              $("#radio-1-3").click(function () {
                            showhide("three");
               });
    }); 
    

    just use hide method

      $(function () {
                 $("#radio-1-2").click(function () {
           $("#shippingzonestate").show('slow');
            $("#shippingzonecountry").hide('slow');
              $("#zipcode").hide('slow');
          $("#Product-Code-SKU").hide('slow');
             });
    
          $("#radio-1-2").click(function () {
          $("#shippingzonestate").show('slow');
          $("#shippingzonecountry").show('slow');
              $("#zipcode").hide('slow');
          $("#Product-Code-SKU").hide('slow')
           });
    
          $("#radio-1-3").click(function () {
         $("#zipcode").show('slow');
          $("#Product-Code-SKU").show('slow');
          $("#shippingzonestate").hide('slow');
          $("#shippingzonecountry").hide('slow');
           });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have three developers and one tester all working against the same database. We
new to jquery here, right now I have a working hide/show function when one
I'm working with Jquery in Drupal. I have sets of four blocks that all
I have a jQuery dialog which loads an external php page. All is working
I have jQuery mobile working with google maps so that I can display one,
Currently all working with my jquery $.post actions, successful connections, query and json_encode return
I'm pretty new to Javascript, Rails and JQuery all working together. I'm going through
Hello all I am working on javascript jquery and svg.I want to ask a
I have a draggable table which all working fine, though I want to be
I've been fighting with jQuery all night and getting quite frustrated here, so forgive

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.