Self-registration DOB validation regex is too lax, should only allow '-' separator

Bug #1774253 reported by John Yorio
52
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Evergreen
Confirmed
Medium
Unassigned

Bug Description

2.11 and 3.0.7

Steps to trigger:

In library settings, enable patron self-registration
Again, in library settings, show the DOB field on the form.
Go to the self-registration URL.
Notice that the example text indicates you can use "-" or "/
Complete the form and enter a birth date with "/" for the separator e.g. 1980/01/01
In the staff client (web or XUL) view the pending patrons
Note here that the date of birth for your patron is as you entered it.
Select your patron and either click Load Patron or double-click to complete the registration process.
Notice when the full registration screen loads so you can finish editing the patron information and save it, the DOB field is blank

To see the expected behavior, repeat the steps but use a DOB of 1980-01-01.

What I expected to happen:

Based on the fact that the DOB field accepts dates with "/", I expected the registration process to carry the birth date all the way through to the patron registration screen, like it does with "-".

It seems either the validation should limit the separator to "-" or if it not, perhaps replace the "/" with "-" so the date will work with the rest of the registration process.

Tags: patron
Changed in evergreen:
status: New → Confirmed
importance: Undecided → Medium
tags: added: patron
Revision history for this message
Terran McCanna (tmccanna) wrote :
Revision history for this message
Elizabeth Davis (elidavis) wrote :

Would adding a calendar date picker help alleviate formatting issues?

Revision history for this message
Jason Stephenson (jstephenson) wrote :

See also bug 1723651 which suggests adding the HTML5 Date field to the OPAC. Note that there were issues with Apple's iOS at the time because Apple crippled the web browsers on that platform. The situation may have changed, but I don't have an iOS device to use for testing.

Revision history for this message
Stephanie Leary (stephanieleary) wrote :

The iOS Safari UI for the HTML5 date input type is notoriously awful, especially for birth date forms that will be used by senior citizens:
https://gist.github.com/RobertAKARobin/850a408e04d5414e67d308a2b5847378

The example suggested there is to use separate month, day, and year fields, and combine them on the back end into whatever format is required. These can be used with the bday-day, bday-month, and bday-year autocomplete attributes so they will be filled in by the browser in most cases where the user is on a device they own.
https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete

Revision history for this message
Stephanie Leary (stephanieleary) wrote :

Related: bug 2012310, all fields in the patron self-registration form need to use the appropriate autocomplete attributes.

Revision history for this message
Galen Charlton (gmc) wrote :

There's a patron PII data handling wrinkle to consider as well: since some libraries no longer wish to store precise birth dates but yet want to gather birth year (and possibly birth month), separating out the inputs and adding some library settings might assist with having the library only ask for as much of the birth date as they actually want.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.