I have a modal where a user fill the data and when user press the submit button, a id fetch from jQuery and save data in datable according to the user id.
So, I have to fetch the id from jQuery and have to pass through PHP variable.
Here is my query for changing my form URL:
$('#get_form').attr('action', '{{ url("admin/report/update/"."$id="obj.data('id'))" }}');
And, here is my form
<form action="" id = "get_form" method="post" class="ajax-form modal-content" enctype="multipart/form-data">
I am unable to set the URL perfectly.
2
Answers
You’re mixing blade with js. Try formatting the url like this: