There are a couple approaches you could use:
- Hide your 'submit' div and show a different, 'Please wait...' div in its place
Set the disabled property on the div when it's clicked, and check for that property in the submit handler
$("div.submit").click(function(e) { if ($(this).prop("disabled")) return false; // any other error checking, setup etc... $(this).prop("disabled", true); // submit the request... });
You could also use a global flag or jQuery's .data() function to mark when the form has been submitted, but I'd recommend the property approach. Once the request has completed, you can then set the disabled property to false, thus allowing the form to be resubmitted later, if desired.