Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1 from mreishus/master

Prevent beforeunload feature from double submitting when clicking submit
  • Loading branch information...
commit c578b0ad23810057cb33bd6c84de09734daeebed 2 parents d129264 + 37ba311
@zeroasterisk authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 jquery.autosaveform.js
View
11 jquery.autosaveform.js
@@ -176,6 +176,17 @@ $.fn.ASF_debug = true; # turn on debug messages in console
}
return false;
});
+
+ // If using unload feature, deregister a form from autosaving upon unload
+ if ($.fn.ASF_beforeunload) {
+ $(form).submit(function() {
+ var ASF_forms = $(window).data("ASF_forms");
+ ASF_forms = $.map(ASF_forms, function(x) {
+ return x === form ? null : x;
+ });
+ $(window).data("ASF_forms", ASF_forms);
+ });
+ }
});
// activate ASF_beforeunload (if not already done)
if ($.fn.ASF_beforeunload) {

0 comments on commit c578b0a

Please sign in to comment.
Something went wrong with that request. Please try again.