how to add form in datatables
how to add form in datatables
![usmanfarzand](https://secure.gravatar.com/avatar/4bec47c1361ebae8c16d96fc250ad63f/?default=https%3A%2F%2Fvanillicon.com%2F4bec47c1361ebae8c16d96fc250ad63f_200.png&rating=g&size=120)
Working code
{ data: 'id' , "render": function ( data, type, full, meta ) {
return
'<a href="/admin/user/'+data+'/'+'edit" class="btn btn-primary" ><span data-feather="edit"></span></a>';
}}
this code is not working
{ data: 'id' , "render": function ( data, type, full, meta ) {
return
'<a href="/admin/user/'+data+'/'+'edit" class="btn btn-primary" ><span data-feather="edit"></span></a>';
+' '+
'<form method="POST" action="{{route('admin.user.destroy', data)}}">
@csrf
@method('DELETE')
<button type="submit" class="btn btn-danger"><span data-feather="delete"></span></button>
</form>'
}}
This discussion has been closed.
Answers
Hi @usmanfarzand ,
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin