From 48b7fabf5991ca92f197444fc52524b59a76ed46 Mon Sep 17 00:00:00 2001 From: Michael Peters Date: Thu, 4 Dec 2014 15:56:53 -0500 Subject: [PATCH] LP#1361266 Patron self-registration form accepts date of birth in wrong format This patch applys some basic javascript to validate that a date entered is at least in ISO 8601 format. This prevents someone from entering "cupcake" or 55/66/6666 as a valid date of birth by validating the stgu.dob input at the time of submission. Signed-off-by: Michael Peters Signed-off-by: Josh Stompro Signed-off-by: Jason Stephenson --- Open-ILS/src/templates/opac/parts/js.tt2 | 14 ++++++++++++++ Open-ILS/src/templates/opac/register.tt2 | 7 ++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/templates/opac/parts/js.tt2 b/Open-ILS/src/templates/opac/parts/js.tt2 index ed68480402..f9600a5f51 100644 --- a/Open-ILS/src/templates/opac/parts/js.tt2 +++ b/Open-ILS/src/templates/opac/parts/js.tt2 @@ -1,6 +1,20 @@ + + + [%- IF ctx.use_stripe %] [% END -%] diff --git a/Open-ILS/src/templates/opac/register.tt2 b/Open-ILS/src/templates/opac/register.tt2 index cb04055550..3c2d6375fb 100644 --- a/Open-ILS/src/templates/opac/register.tt2 +++ b/Open-ILS/src/templates/opac/register.tt2 @@ -42,7 +42,7 @@ register_fields = [ # The dojo date widget in the patron edit UI only accepts default # values in ISO8601 format. It will not accept locale-shaped dates. IF !ctx.register.settings.stgu.dob.example; - ctx.register.settings.stgu.dob.example = l('YYYY-MM-DD'); + ctx.register.settings.stgu.dob.example = l('YYYY-MM-DD or YYYY/MM/DD'); END; %] @@ -96,7 +96,7 @@ END; ) | html %] [% END %] -
+
@@ -141,7 +141,8 @@ FOR field_def IN register_fields; [% IF require %] -- 2.11.0