This is my list. How to Delete a record using Student Name not using ID.This is the code which I tried delete function using ID.
$("#btnDeleteStudent").click(function()
{
var IdNo = $("#txtDeleteStudent").val();
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getByTitle('Student Details')/items("+IdNo+")",
type: "DELETE",
headers: {
"Accept": "application/json;odata=verbose" ,
"contentType": "application/json;odata=verbose" ,
"X-RequestDigest": $("#__REQUESTDIGEST").val(),
"IF-MATCH": "*",
"X-HTTP-Method": "DELETE"
},
success: function(data) {
alert("Item Deleted successfully");
},
eror: function(data) {
alert("An error occurred. Please try again.");
}
});
});