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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:45:53+00:00 2026-05-27T23:45:53+00:00

I am trying to disable every input field in a specific part of a

  • 0

I am trying to disable every input field in a specific part of a web form whenever a radio button is set to the “No” option (and revert this when “Yes” is selected, but am not getting it working properly. I currently have this code for “watching” the radio buttons and enabling/disabling as required:

jQuery("#ReportOn").change(function () {
    if(jQuery("#ReportOff").is(":checked")) {
        // Everything working up until here , but below command does nothing.
        jQuery("#reportform > input").attr("disabled", true);
    } else if(jQuery("#ReportOn").is(":checked")) {
        jQuery("#reportform > input").removeAttr("disabled");
    }
});

The form looks like this:

<form method="post" action="post.php">
    <input type="radio" name="report" id="ReportOn" value="1" /><label for="ReportOn">Yes</label>
    <input type="radio" name="report" id="ReportOff" value="0" /><label for="ReportOff">No</label>
    <div id="reportform">
        <input type="text" name="title" id="ReportTitle" />
        <input type="text" name="subtitle" id="ReportSubtitle" />
    </div>
</form>

Whenever the Reporting radio button is set to No, the rest of the form should be disabled.

What am I missing here that prevents it from working?

  • 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-27T23:45:54+00:00Added an answer on May 27, 2026 at 11:45 pm

    Try changing:

    jQuery("#reportform > input")
    

    to:

    jQuery("#reportform input")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So every 'special-input' div contains an input field. I am trying regulate when each
I have lots of input fields in my form and on every field change
I am trying to bulk disable all the submit buttons present in my form.
In the following code, I have been trying to disable the entry1 widget every
I am trying to loop through a specific form on my page. I basically
Im trying to disable a feature on mobile safari, but not really sure how
I am trying to disable the logo in my metro app live tile so
I am trying to disable the system keyboard shortcuts with following code: #import AppDelegate.h
I am trying to disable a particular cell in a particular table. I want
I am trying to disable the top menu for jquery sliding tabs . I

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.