From: Garry Collum Date: Tue, 9 Nov 2021 16:09:48 +0000 (-0500) Subject: LP1950166 TPac: Self-registration form won't submit with blank DOB X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=6cd8c1013daa08eac0a77c3af286671c3c978019;p=Evergreen.git 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 --- diff --git a/Open-ILS/src/templates/opac/parts/js.tt2 b/Open-ILS/src/templates/opac/parts/js.tt2 index 71512eceb9..c597c31863 100644 --- a/Open-ILS/src/templates/opac/parts/js.tt2 +++ b/Open-ILS/src/templates/opac/parts/js.tt2 @@ -33,7 +33,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