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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:39:18+00:00 2026-06-12T00:39:18+00:00

I have to elements radio button and text field: <label><input id=GRP010 type=RADIO value =900>Radio

  • 0

I have to elements radio button and text field:

<label><input id="GRP010" type="RADIO" value ="900">Radio button</label>
    <input id="AF92" maxlength="254" size="15" name="AF92">

I want using jquery to disable text field, but enable it when the radio button is checked and value is equal.

So far I have wrote this:

$(document).ready(function(){

    var value2 = $('input:radio[name="GRP010"]').val();
    var checked2 = $('input:radio[name="GRP010"]').is(':checked');

    if (checked2 == true && value2 == '900') {
        $("#AF92").attr("enabled", "enabled");
    } else {
        $("#AF92").attr("disabled", "disabled"); 
    }
});

However, the text field is disable and not enabled if I select the radio button. How to I achieve this? 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-12T00:39:19+00:00Added an answer on June 12, 2026 at 12:39 am

    There is no attribute called enabled it is only disabled, to use it do this

    $("#AF92").attr("disabled","disabled"); // will disable
    $("#AF92").removeAttr("disabled"); // to enable
    

    You also have other problems. First, you are trying to target your input by the wrong attribute name="GRP010 which does not exist, since you have an id just use that. Also, you don’t have an event handler to change the status of the input once the radio button changes, see the live fiddle

    Also, it would be better to start the input as disabled.

    Here is the event handler

    $('#GRP010').on('change', function(){
    var checked = this.checked;
    
        if(checked && value2 == '900')
            $("#AF92").removeAttr("disabled");
        else
            $("#AF92").attr("disabled","disabled");
    })
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got this HTML form where I have multiple input elements: text, radio, and
I have a text input area attached to a radio button in an HTML
<form id=youtube-form method=post action=> <label for=searchField id=label-youtube-id>YouTube ID:</label> <input type=text id=searchField name=videoid class=search-field />
All I have the following form input element: <input name=payment_amount type=text id=payment_amount value= disabled>
I have the following HTML: <input type=radio name=beds value=1 />1+ <input type=radio name=beds value=2
I have this rule in my stylesheet: input:not([type='button']):not([type='submit']):not([type='checkbox']):not([type='radio']), select { padding:8px; width:224px; border:1px solid
I have a radio button: <input type=radio>test</input> and I would like to retrieve the
I have javascript, which is in iframe. When i check radio button in iframe,
I have a PHP form that presents the user with two radio button options
I have my own content type made in my module. It has text and

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.