Skip to content

Instantly share code, notes, and snippets.

@ohokay
Created August 24, 2010 19:53
Show Gist options
  • Save ohokay/548188 to your computer and use it in GitHub Desktop.
Save ohokay/548188 to your computer and use it in GitHub Desktop.
var _form_valid = false;
$("form").submit(function(e) {
var self = this;
if(!_form_valid) {
e.preventDefault();
$.ajax({
'url' : 'http://where.com',
'dataType' : 'post',
'success' : function() {
self.submit();
_form_valid = true;
}
}); // end ajax
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment