Im using this script to disable and enable input box. When I check the box, the input is enabled, but when I uncheck the box the input is still enabled.

Not sure how to fix this.

$(document).ready(function(){
    $(".ncjhs_student").attr("disabled",true);
    $(".send_records").attr("disabled",true);


    $("#send_records").click(function(){
         $(".send_records").removeAttr("disabled");
     });
    $("#ncjhs_student").click(function(){
         $(".send_records").removeAttr("disabled");
     });
});

Figured it out:

<script>
$(document).ready(function(){
    $(".inputClassname").attr("disabled",true);
    $("#radioButtonId").change(function(){
        if($('#radioButtonId').is(':checked')){
            $(".inputClassname").removeAttr("disabled");
        }
     });
    $("#home").change(function(){
        if($('#home').is(':checked')){
            $(".ncjhs_student").attr("disabled",true);
        }
     });

/*Checkbox's below*/

    $(".inputClassname").attr("disabled",true);
    $("#checkboxId").change(function(){
        if($('#checkboxId').is(':checked')){
            $(".inputClassname").removeAttr("disabled");
        }else{
            $(".inputClassname").attr("disabled",true);
        }

     });

});
</script>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.