$.getJSON('/CourtHouseManagement/LoadLawCourt/?cityId=' + id, function (result) {
$('#JusticeCourtTable').html('');
for (var i = 0; i < result.length; i++) {
var tablestring =
'<tr>' +
'<th>' + result[i].CourtID + '</th>' +
'<th><button type="button" class="btn btn-sm btn-primary" onclick="javascript:selectClaimant(' + result[i].CourtID + ',\'' + result[i].Name +');">Update</button></th>'+ //Problem HERE
'<th><button type="button" class="btn btn-sm btn-primary" onclick="javascript:selectClaimant(' + result[i].CourtID + ',\'' + result[i].Name +');">Delete</button></th>' //Problem HERE
tablestring += '</tr>';
$("#JusticeCourtTable").append(tablestring);
}
});
}
}
function selectClaimant(CourtID, Name) {
alert(CourtID + Name);
}
I load datas to table.If **i click to "Delete" or "Update" button , ı want to send CourtID and Name for selected row.**I tried above code.When i click to "Update" or "Delete" button , i get below exception.
Uncaught SyntaxError: Unexpected number
When i click to button "selectClaimant" function never works.Where i miss exaclty ? How can i send CourtID and Name on "Update" or "Delete" button click ?
Any help will be appreciated.
Thanks.