$('#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)}}
CodePudding user response:
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);