0

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");
     });
});
1
Contributor
1
Reply
2
Views
5 Years
Discussion Span
Last Post by gabrielcastillo
0

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>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.