In my code I have a button for entering data, but as shown in the image below it only reads the first line independent of the button.
I believe this is because the button id is not being assigned to each row.
How can I get my id from each row to my button?
My ID is ID_Info
<td>
<button class="btn ToEditbtn" ><span class="fa fa-plus-square" aria-hidden="true"></span>Edit</button>
<button class="btn Editbtn" style="display:none"><span class="fa fa-plus-square-o" aria-hidden="true">Save</span></button>
</td>
@section scripts{
<script>
$(function () {
$("#ordertable").on("click", ".ToEditbtn", function () {
$(this).hide();
var currenttr = $(this).closest("tr");
currenttr.find(".Editbtn").show();
currenttr.find(".Status").prop("disabled", false);
currenttr.find(".Obs").prop("disabled", false);
});
//update
$("#ordertable").on("click", ".Editbtn", function () {
var status = new Object();
status.ID_Info = $(".ID_Info").val();
status.Status = $(".Status").val();
status.Obs = $(".Obs").val();
...
<script>
}
Thanks
