From bf7e754f29db720f7dfdaf385ea30b0a62faf762 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 22 Oct 2013 05:15:07 +0000 Subject: [PATCH] Bug 11002: (follow-up) use jQuery validator plugin This patch uses the jQuery validator plugin introduced in bug 6209 for two reasons: [1] To supply validation for non-HTML5-compatible web browsers. [2] To force use of the validator plugin rather than built-in validation for HTML5 browsers, which means that our translations will be used. Note that a version of the function to prevent double form submission is used as the submit handler invoked when the validator plugin is satisified that the form is complete. To test: [1] Same as the main test plan, but note that the validation messages now appear inline rather than as pop-ups. [2] Verify that the double form submission prevention still works. Signed-off-by: Galen Charlton (cherry picked from commit e52bd72c650787e9c7690b7cfe172a9d9feab698) Signed-off-by: Tomas Cohen Arazi --- .../prog/en/modules/members/memberentrygen.tt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index 697931d049..06d02b9214 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -33,7 +33,16 @@ } [% END %] $("#dateofbirth").datepicker({ maxDate: "-1D" }); - $("#entryform").preventDoubleFormSubmit(); + $("#entryform").validate({ + submitHandler: function(form) { + $("body, form input[type='submit'], form button[type='submit'], form a").addClass('waiting'); + if (form.beenSubmitted) + return false; + else + form.beenSubmitted = true; + form.submit(); + } + }); }); function clear_entry(node) { -- 2.39.5