Skip to content

Instantly share code, notes, and snippets.

@DCarper
Created March 22, 2011 19:15
Show Gist options
  • Select an option

  • Save DCarper/881846 to your computer and use it in GitHub Desktop.

Select an option

Save DCarper/881846 to your computer and use it in GitHub Desktop.
var form_not_submitted = true;
$( function() {
$("form").validate({ rules: {...}, submitHandler: submitOnce});
})
var submitOnce = function(form) {
if ( form_not_submitted )
{ form_not_submitted = false; alert('hi'); form.submit(); }
else { return false }
}
// as is, the alert only fires 1 time but the form can be submitted multiple
// I can literally take the form.submit() call out, and the alerts only fire as expected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment