From a3a1d10a50da74f6895642cde88817a09a4f7437 Mon Sep 17 00:00:00 2001 From: Garry Collum Date: Tue, 9 Nov 2021 11:09:48 -0500 Subject: [PATCH] LP1950166 TPac: Self-registration form won't submit with blank DOB Adds a check for a blank value in the DOB validation script. Note that the issue is present in TPAC, not the Bootsstrap OPAC. To test: 1. Confirm "Require dob field on patron registration" is not set or set to False. 2. Confirm "Show dob field on patron registration" is true. 3. Confirm "Allow Patron Self-Registration" is set to true. 4. Try to register a patron in the TPAC with DOB blank. 5. Apply patch. 6. Try to register a patron in the TPAC with the DOB blank. 7. Try to register a patron with Invalid DOB input. 8. Try to register a patron with valid DOB input. Signed-off-by: Garry Collum Signed-off-by: Gina Monti Signed-off-by: Galen Charlton --- Open-ILS/src/templates/opac/parts/js.tt2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Open-ILS/src/templates/opac/parts/js.tt2 b/Open-ILS/src/templates/opac/parts/js.tt2 index aa4e9f54da..5d9349af27 100644 --- a/Open-ILS/src/templates/opac/parts/js.tt2 +++ b/Open-ILS/src/templates/opac/parts/js.tt2 @@ -28,7 +28,7 @@ function dobValidate(input) { var validformat = /^(19|20)\d\d([- /.])(0[1-9]|1[012])\2(0[1-9]|[12][0-9]|3[01])$/ var returnval = false - if (!validformat.test(input.value)) + if (input.value != '' && !validformat.test(input.value)) alert("[% l('You have entered an invalid date, or an improperly formatted date. Please enter Date of Birth in YYYY-MM-DD or YYYY/MM/DD format and try again.') %]") else returnval = true -- 2.11.0