Issue
$('#formid').attr('action','table/'+id);
I am using a form with form id 'formid' and 'id' is a variable containing id, this is the working code but I want to give route name instead of url , route is-
{{route('table.update',id)}}
Solution
Just Do this
var url = '{{ route("table.update", ":id") }}';
url = url.replace(':id', id);
$('#formid').attr('action',url);
OR
var url = "{{route('table.update', '')}}"+"/"+id;
$('#formid').attr('action',url);
Answered By - msk
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.