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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:41:47+00:00 2026-06-06T16:41:47+00:00

I want to display a div if a certain radio button in a form

  • 0

I want to display a div if a certain radio button in a form is selected, but hide that div if any other radio button in the form is selected, using jquery.

This is the code I have that isn’t working:

$("select").change(function(){
if($("#radio1").is(":selected")){
    $("#grid_9 omega").slideDown("slow");
} else { $("#grid_9 omega").slideUp("slow"); } 
});

where the id for the radio button I want to have display the div “gid_9 omega” is “radio1”.

Thanks for your help!

  • 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-06T16:41:49+00:00Added an answer on June 6, 2026 at 4:41 pm

    I took the liberty of thinking that maybe omega was a class that you were referring to incorrectly.

    First, there is no select here so that is not going to work for you. You need to test on all input[type=radio].

    Next, radio button attribute for selected is actually checked=checked, so you need to test if the one you want to be checked is checked. If not, do nothing, if so, show your div.

    A JSFiddle

    Using a similar html structure to this below:

    <form id="form1" name="form1" method="post" action="">
      <p>
        <label>
          <input type="radio" name="RadioGroup1" value="radio1" id="radio1" />
          Radio 1</label>
        <br />
        <label>
          <input type="radio" name="RadioGroup1" value="radio2" id="radio2" />
          Radio 2</label>
        <br />
        <label>
          <input type="radio" name="RadioGroup1" value="radio3" id="radio3" />
          Radio 3</label>
        <br />
      </p>
    </form>
    <div id="grid_9" class="omega" style="display:none">show me when Radio 1 is chosen​​​​​
    

    your js would look like this:

    $(document).ready(function() {
        $("input[type=radio]").on('click', function(){
            if ($('#radio1').is(':checked')){
                $("#grid_9.omega").slideDown("slow");
            } else { 
                $("#grid_9.omega").slideUp("slow");
            }
        });
    });
    

    ​

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

Sidebar

Related Questions

I need to hide a div that has a certain string in it, using
I have a php form and I want to display or hide certain fields
I want to display a form in a Div, in alert box. How would
Hy, I want to display a certain part (a div for example) of my
I am building a menu that I want to display in a certain way.
I'm using Javascript/Jquery to have a button toggle which div is displayed in the
I've got a small script that detects if the user is using a certain
I’m looking for an easy way to hide everything except a certain div and
I have a DIV element that appears when a certain action is performed. For
In My HTML Page I want to display certain Number of Buttons Based on

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.