hi,
i wrote a html code to display the table information in disable mode. but if i click on the check box/boxes, those checked row/rows should be in editable mode.
<tbody>
@foreach(StudentsEnquire enqire in Model.StudentEnquire)
{
<tr>
<td>@Html.CheckBox("status"+enqire.StudentId, new { value = enqire.StudentId, @class = "EnquireCheckBox" })</td>
<td>@Html.TextBox(enqire.SName, enqire.SName, new { @class = "textdisable", @disabled = "disabled" })</td>
<td>@Html.TextBox(enqire.SCourse, enqire.SCourse, new { @class = "textdisable", @disabled = "disabled" })</td>
<td>@Html.TextBox(enqire.SQualification, enqire.SQualification, new { @class = "textdisable", @disabled = "disabled" })</td>
<td>@Html.TextBox(enqire.SContact, enqire.SContact, new { @class = "textdisable", @disabled = "disabled" })</td>
<td>@Html.TextBox(enqire.email, enqire.email, new { @class = "textdisable", @disabled = "disabled" })</td>
<td>@Html.TextBox(enqire.SAddress, enqire.SAddress, new { @class = "textdisable", @disabled = "disabled" })</td>
<td>@Html.TextBox(enqire.Remarks, enqire.Remarks, new { @class = "textdisable", @disabled = "disabled" })</td>
</tr>
}
</tbody>
jquery code:
$('.EnquireCheckBox').click(function () {
var result = $('input[type="checkbok"]:checked').closest('tr').children();
if ($(this).prop("checked") == true) {
$('.textdisable').prop('disabled', false);
var value = $(this).val();
}
else if ($(this).prop("checked") == false) {
}
});
this jquery code is enabling all the text boxes which are not checked also
What I have tried:
i wrote a html code to display the table information in disable mode. but if i click on the check box/boxes, those checked row/rows should be in editable mode.
this jquery code is enabling all the text boxes which are not checked also