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 <gcollum@gmail.com>
Signed-off-by: Gina Monti <gmonti@biblio.org>
Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
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