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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:35:43+00:00 2026-05-27T04:35:43+00:00

You have not selected X does not hide after a radio button has been

  • 0

“You have not selected X” does not hide after a radio button has been selected.

script:

 $('input').live('change', function ()
 {
   if($('debt:radio:checked')) {
     $('.debt1').html('<span style="display:none"></span>');}
   if($('assets:radio:checked')) {
     $('.assets1').html('<span style="display:none"></span>');}
   if($('kids:radio:checked')) {
     $('.kids1').html('<span style="display:none"></span>');}
 });

html:

    Debt: <br />
    <input name="debt" type="radio" value="0" />
    <input name="debt" type="radio" value="-1" />
    <input name="debt" type="radio" value="-2" /><br />


    Kids:<br />
    <input name="kids" type="radio" value="0" />
    <input name="kids" type="radio" value="1" />
    <input name="kids" type="radio" value="3" /><br />


    Assets:<br />
    <input name="assets" type="radio" value="4" />
    <input name="assets" type="radio" value="5" />
    <input name="assets" type="radio" value="6" /><br />

    <br />

    <span class="debt1">You have not selected debt</span><br />
    <span class="kids1">You have not selected kids</span><br />
    <span class="assets1">You have not selected assets</span><br />

Sample here: http://jsfiddle.net/ZJpRj/1/

Working example here: http://jsfiddle.net/ZJpRj/6/

  • 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-27T04:35:44+00:00Added an answer on May 27, 2026 at 4:35 am

    First, you didn’t select jquery in your fiddle.

    Then, your if statement needs to change a lot.

    if($('debt:radio:checked')) {
    

    Should be something more like this:

    if($('input[name="debt"]:radio:checked').length > 0) {
    

    Your code has a few issues. First, the selector debt:radio:checked. Just putting dept would match an element like <dept></dept>, not an input with the name dept. And 2nd, if($("...")) will always return true, because jquery always returns an object. You want to check if that object contains any elements, which is why I use length.

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

Sidebar

Related Questions

I have a problem of jQuery's live() function not working with click, mousedown but
I have implemented the jquery autocomplete combobox, however the change event does not seem
I have a datagridview that may or may not have rows selected when the
I have not been able to find a way to cancel/terminate asynchronous read operation
I have not used Windows Vista. I knew that many APIs have been changed/deprecated
I have a form with some select lists that will show/hide more input fields
I have the often discussed drawRect not getting called. I've been through many posts,
I have two spans that appear or hide when their respective option is selected
have not tested on windows. but in ubuntu when u disconnect from the network,
I have not used generics much and so cannot figure out if it is

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.