Answers for "Laravel ajax form submit"

0

Laravel ajax form submit

$('#comment').on('submit', function(e) {
       e.preventDefault(); 
       var name = $('#name').val();
       var message = $('#message').val();
       var postid = $('#post_id').val();
       $.ajax({
           type: "POST",
           url: host+'/comment/add',
           data: {name:name, message:message, post_id:postid}
           success: function( msg ) {
               alert( msg );
           }
       });
   });
Posted by: Guest on August-20-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language