Looking over the code, you appear to have something that should be working. Using your browser's debug tools, is the AJAX request logged in the console? Is Laravel returning a response with the customer records? Or is it just not displaying in the DOM after the results are returned?
Laravel is giving an error that $customers is not set when loading the view. Am I passing this the wrong way?
First thing I noticed is, the way you are getting entry
$entry = $_POST['email'];
This might be wrong, you need to write it like,
$entry = Input::get('email');
One more thing is, you will get $customers in your data variable in javascript upon success, You need parse it there and use then. Check the code below! I was facing same problem. I removed dataType: "json", and it worked. Refer code given below. It is working for me!
$.ajax({
type: 'POST',
url: "Your_URL",
data: new FormData($('.form')[0]),
processData: false,
contentType: false,
success: function(output) {
console.log(output);
if (output == 'success')
successHandler2.show();
else {
//Show error
}
},
error: function(data) {
//Show error
}
});
If this code does'nt work then change
data: new FormData($('.form')[0])
to
data: new FormData($('#yourformid')[0])
All the best!
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community