Reputation: 1
this may sound silly but need to know how i could enable and disable textbox on checkbox click event in mvc. I am populating few items in a list and need to fill quantity in a textbox after corresponding checkbox is checked..
Upvotes: 0
Views: 1150
Reputation: 1151
I would suggest using jQuery to pull this one off.
Your code would look something like this if you use jQuery:
$("#yourCheckBox").click(function () {
$('#yourTextBox').attr("disabled", $(this).is(':checked'));
});
Upvotes: 1