Bug 4054 - Double-clicking the 'place hold' button can result in duplicate holds
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / js / staff-global.js
index f491773..24b785d 100644 (file)
@@ -92,4 +92,13 @@ function checkEnter(e){ //e is event object passed from function invocation
 
 function clearHoldFor(){
        $.cookie("holdfor",null, { path: "/", expires: 0 });
-}
\ No newline at end of file
+}
+
+jQuery.fn.preventDoubleFormSubmit = function() {
+    jQuery(this).submit(function() {
+        if (this.beenSubmitted)
+            return false;
+        else
+            this.beenSubmitted = true;
+    });
+};
\ No newline at end of file