I have a table which have list of rows and every row have two checkboxes what I am trying to do is when someone check on check box it send request to server using ajax and reponsev with data if it pass it change the tr color to green if fail it change to red..I am done with this step
Now I want when it is success it should enable other check box which is on the same tr so now user can process with the second step.
$("#SendReview").click(function() {
var selected = "";
$('.ReviewForm').each(function() {
selected = selected + "," + $(this).attr('id');
});
$.ajax({
url: '@Url.Action("VerifyFormRquest", "Results")',
type: "POST",
data: {
scanid: selected
},
success: function(data, textStatus, jqXHR) {
alert(data.success);
data.success.split(',').forEach(function(c) {
if (c != "") {
var m = $('#example tr:has(td:contains(' + c + '))').css('background-color', 'lightgreen');
}
});
},
error: function(jqXHR, textStatus, errorThrown) {}
});
});
<table id="example">
<tr id="1000000107">
<td>
<input type="checkbox" id="J15000001" scanid="1000000103" onclick="call()" disabled="disabled" value="1000000103" class="ELOchecked">
</td>
</tr>
<tr id="1000000107">
<td>
<input type="checkbox" id="J15000012" scanid="1000000107" disabled="disabled" value="1000000107" class="ELR">
</td>
</tr>
</table>