I want to delete the record using ajax.
view
@foreach( $products as $product )
{{ $product->code
-
As @Rob_vH mentioned, your problem is with how you're getting the ID in your JavaScript. Try changing this:
var dataId = $('#btnDeleteProduct').attr('data-id');
to this:
var dataId = $(this).attr('data-id');
- 热议问题