Here is a very simple implementation that i've used:
$("#yourFormName").submit(function(e) {
e.preventDefault();
var form = $('#yourFormName');
var url = "/orders/create"; // the script where you handle the form input.
$('#loadingImage').show();
$(":submit").attr("disabled", true);
$.ajax({
type: "POST",
dataType: 'json',
url: url,
data: form.serialize(), // serializes the form's elements.
success: function(data) {
// Do stuff here
},
error: function(){}
});
});
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community