69
rated 0 times
[
71]
[
2]
/ answers: 1 / hits: 36052
/ 5 Years ago, sat, april 6, 2019, 12:00:00
I have a prescription form and submitted the form using AJAX.
Now I want to automatically redirect to another route from AJAX after the form successfully submitted.
I have tried with several options like
window.location.href = { url('/show-all-prescription') }
and
{{ route('/show-all-prescription')}}
AJAX CODE
jQuery.ajax({
url:{{ url('/submit_prescription') }},
type: 'GET',
data: {name: name, age: age, mobile_no: mobile_no},
success:function(msg){
if(msg>0)
{
// window.location.href = { url('/show-all-prescription') };
{{ route('/show-all-prescription')}}
}
}
});
And got the error
Route [/show-all-prescription] not defined
route.php
Route::get('/show-all-prescription', 'prescriptionController@show_all_prescription');
But not getting the result. Someone Help Please?
More From » php