Wednesday, March 12, 2014

enable textbox by click on checbox using jquery?

You can do it like this:
$("#checkBoxID").click(function() {
  $("#buttonID").attr("disabled", !this.checked);
});

$("#yourcheckboxid").click(function() {
    var checked_status = this.checked;
    if (checked_status == true) {
       $("#yourbuttonid").removeAttr("disabled");
    } else {
       $("#yourbuttonid").attr("disabled", "disabled");
    }
});

No comments:

Post a Comment