Bug 41118 - jQuery Validation doesn't add correct error id to flatpicker fields in patron form
Summary: jQuery Validation doesn't add correct error id to flatpicker fields in patron...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-28 10:31 UTC by Emmi Takkinen
Modified: 2025-10-28 10:31 UTC (History)
2 users (show)

See Also:
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:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.