showing results for - "jquery ajax post request in laravel"
Alix
13 Sep 2019
1<script>
2
3  $(".save-data").click(function(event){
4      event.preventDefault();
5
6      let name = $("input[name=name]").val();
7      let email = $("input[name=email]").val();
8      let mobile_number = $("input[name=mobile_number]").val();
9      let message = $("input[name=message]").val();
10      let _token   = $('meta[name="csrf-token"]').attr('content');
11
12      $.ajax({
13        url: "/ajax-request",
14        type:"POST",
15        data:{
16          name:name,
17          email:email,
18          mobile_number:mobile_number,
19          message:message,
20          _token: _token
21        },
22        success:function(response){
23          console.log(response);
24          if(response) {
25            $('.success').text(response.success);
26            $("#ajaxform")[0].reset();
27          }
28        },
29       });
30  });
31</script>
queries leading to this page
laravel button do post ajaxajax post request syntax laravel how to send post ajax request in laravellaravel post ajaxajax post in laraveljquery ajax post request in laravelsend post ajax with jquery on blade laravelhow to use ajax post request in laravellaravel ajax postajax post method with laravelsend jquery ajax request laravelpost data ajax call laravellaravel post ajax requestajax post data in laravellaravel post ajax htmlpost request laravel ajaxajax post method in laravwlsend request ajax jquery laravellaravel 8 ajax postpost data with ajax laravelsend parameter in ajax post laravelajax post laravellocal ajax post to laravellaravel ajax post requestlaravel get ajax post datahow to send ajax request in laravel controllerajax post data laravelpost ajax laravellaravel 6 ajax postlaravel ajax send request to controllerlaravel post ajax response to htmllaravel jquery ajax postajax send post request laravelajax post request in laravelsend request ajax jquery using laraveljquery ajax post request example in laravel 5 7ajax send form data laravelpost ajax jquery laravellaravel and ajax postajax post laravel routeajax post request laravelajax post php laravelhow to send ajax request from laravel controllerhow to send ajax request in laraveljquery ajax post request laravellaravel ajax post examplelaravel send data ajax requestjavascript ajax laravel postsend ajax request laravelsend data using ajax in laravellaravel post request from ajaxposts laravel with ajaxpost laravel ajaxon change send data into ajax request in laraveljquery ajax post json laravellaravel ajax post web phpajax post call laravel controllerhow to send data in ajax post in laraveljquery ajax post laravelsend ajax request in laravlesend data through ajax in laravel ajax with post method in laravelsending post request in laravel ajaxajax post post laravelsend ajax request jquery laraveljquery ajax post request in laravel