Bug 41118

Summary: jQuery Validation doesn't add correct error id to flatpicker fields in patron form
Product: Koha Reporter: Emmi Takkinen <emmi.takkinen>
Component: PatronsAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: gmcharlt, kyle
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Crowdfunding goal: 0
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Emmi Takkinen 2025-10-28 10:31:18 UTC
I'm not sure if Patrons is right component for this but I noticed this while working on bug 34671. When patron add/mod form is send jQuery Validation plugin validates the fields and checks if any mandatory field is empty. If they are, it adds an error element next to invalid field. This element has an id formed from input fields id and string "-error", e.g. firstname field has id "firstname-error". This however doesn't work with flatpicker fields like date of birth field. In them id is just "-error".

To reproduce:
1. Make sure you have date of birth field set as mandatory in patron add/modification form.
2. Add or modify patron but leave date of birth field empty.
3. Attempt to save the patron, "This field is required" message is added next to date of birth field.
4. Inspect element with browsers devtools (right click element and select inspect).
=> Note that element has just id "-error" attached to it.