Support the ongoing development of Laravel.io →
posted 9 years ago
Requests
Last updated 2 years ago.
0

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(){}
            });
  });
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

seupoj seupoj Joined 6 Jul 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.