From e52a8537369fe5569238493e55743034c3a77a8c Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 27 Apr 2017 13:24:06 +0000 Subject: [PATCH] Bug 3311 [Follow-up] Statistical reports should error if row and column aren't selected This patch moves the validation JavaScript from the body of the page to the . The "validated" class is removed from the form so that there is not a conflict between default error handling and the custom validation added to the page. To test, apply the patch and verify that form validation still enforces a selection of both row and column and that the error messages display in the table header. --- .../prog/en/modules/reports/catalogue_stats.tt | 29 ++++++++++------------ 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_stats.tt index b48d9d5..00a3472 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_stats.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_stats.tt @@ -36,6 +36,18 @@ changeRemovedDateTrStatus(); }); changeRemovedDateTrStatus(); + + $("#configure_report").validate({ + errorPlacement: function(error, element) { + if (element.attr("name") == "Line") { + $("#LineError").html( error ); + } else if (element.attr("name") == "Column") { + $("#ColumnError").html( error ); + } else { + error.insertAfter(element); + } + } + }); }); //]]> @@ -99,7 +111,7 @@ [% END %] [% ELSE %] -
+
Catalog statistics @@ -277,21 +289,6 @@ -

-- 2.1.4