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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:59:26+00:00 2026-06-05T16:59:26+00:00

Little help if you don’t mind. Basically, I have 3 radio boxes and a

  • 0

Little help if you don’t mind.

Basically, I have 3 radio boxes and a div. When the 3rd radio box is selected the div should become visible. However, radio boxes can be checked when the page loads, so if the 3rd box is checked the div needs to be shown, otherwise it should be hidden initially but become visible if the 3rd box is checked later on.

HTML:

<input type="radio" name="image_location" value="featured_image" />
<input type="radio" name="image_location" value="all_images" />
<input type="radio" name="image_location" value="custom_field" />

<div id="image_location_custom_field">
    ** Content **
</div>

Where I’ve got so far with the JavaScript:

jQuery('input[name=image_location]').hide();
jQuery('input[name=image_location]').change(function() {
  var selected = jQuery(this).val();
  if(selected == 'custom_field'){
      jQuery('#caption_custom_field').show();
  } else {
      jQuery('#caption_custom_field').hide();
  }
});

Many thanks

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

    just check if the radiobutton is checked an show the div, you can also use css to hide the div

    <input type="radio" name="image_location" value="featured_image" />
    <input type="radio" name="image_location" value="all_images" />
    <input type="radio" name="image_location" value="custom_field" />
    
    <div style="display:none" id="image_location_custom_field">
        ** Content **
    </div>​
    //on dom ready
    if (jQuery('input[value=custom_field]:checked').length > 0){
        jQuery('#image_location_custom_field').show()
    }
    else {
        jQuery('#image_location_custom_field').hide();
    }
    jQuery('input[name=image_location]').change(function() {
      var selected = jQuery(this).val();console.log(selected);
      if(selected == 'custom_field'){
          jQuery('#image_location_custom_field').show();
      } else {
          jQuery('#image_location_custom_field').hide();
      }
    });
    

    W/O check FIDDLE
    with check FIDDLE

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

Sidebar

Related Questions

Need a little help with a SQL / ActiveRecord query. Let's say I have
I need a little help brainstorming on a query. I have a sales table
I'm having a little trouble switching views and wondering anyone can help. Basically the
I'm new to Obj-C and I'm looking for a little help. I have a
I need a little help. I have an XML file in a web and
I have a little problem in C++ I don't know how to solve. The
I have a little problem with plists. I don't know how to read data
I have this little problem and I am requesting for your help. I have
I have a little experience with bug tracking systems such as FogBugz where help
Can I get a little help with this? In a test project, I have

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.