Bug 39773 - OPAC ILL form does not use client-side form validation for required fields
Summary: OPAC ILL form does not use client-side form validation for required fields
Status: Needs documenting
Alias: None
Product: Koha
Classification: Unclassified
Component: ILL (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Pedro Amorim
QA Contact: Lucas Gass (lukeg)
URL:
Keywords:
Depends on: 38340
Blocks:
  Show dependency treegraph
 
Reported: 2025-04-29 12:23 UTC by Pedro Amorim
Modified: 2025-09-29 15:21 UTC (History)
5 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
The OPAC interlibrary loan request form now uses browser-based client-side validation for required fields. When creating a new ILL request, required fields (such as request type) are validated before the form is submitted, providing immediate feedback to users if required information is missing. This enhancement improves the user experience by: - Highlighting required fields that are empty when the user attempts to submit - Preventing incomplete forms from being submitted to the server - Reducing unnecessary page reloads for validation errors This validation applies to both authenticated ILL requests and unauthenticated requests (when the ILLOpacUnauthenticatedRequest system preference is enabled).
Version(s) released in:
25.11.00,25.05.03
Circulation function:


Attachments
Bug 39773: Add 'required' attribute for required fields (2.66 KB, patch)
2025-04-29 12:26 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 39773: Add 'required' attribute for required fields (3.68 KB, patch)
2025-04-29 12:57 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 39773: Add 'required' attribute for required fields (3.73 KB, patch)
2025-05-06 22:04 UTC, Roman Dolny
Details | Diff | Splinter Review
Bug 39773: Add 'required' attribute for required fields (3.79 KB, patch)
2025-07-25 16:25 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Amorim 2025-04-29 12:23:10 UTC
We're already using a required parameter. We should make use of it in the HTML and add the 'required' attribute to the HTML inputs.
Comment 1 Pedro Amorim 2025-04-29 12:26:08 UTC Comment hidden (obsolete)
Comment 2 Pedro Amorim 2025-04-29 12:57:19 UTC
Created attachment 181650 [details] [review]
Bug 39773: Add 'required' attribute for required fields

Test plan, apply patch:
1) Enable ILLModule
2) Create a new OPAC request, visit:
http://localhost:8080/cgi-bin/koha/opac-illrequests.pl?op=add_form&backend=Standard
3) Press 'Create'. Notice the required 'type 'is now validated before the form is submitted.

Additional testing:
1) Enable ILLOpacUnauthenticatedRequest. Log out. Repeat 2)
2) Press 'Create'. Notice the required unauthenticated fields are highlighted as required.
Comment 3 Roman Dolny 2025-05-06 22:04:44 UTC
Created attachment 182009 [details] [review]
Bug 39773: Add 'required' attribute for required fields

Test plan, apply patch:
1) Enable ILLModule
2) Create a new OPAC request, visit:
http://localhost:8080/cgi-bin/koha/opac-illrequests.pl?op=add_form&backend=Standard
3) Press 'Create'. Notice the required 'type 'is now validated before the form is submitted.

Additional testing:
1) Enable ILLOpacUnauthenticatedRequest. Log out. Repeat 2)
2) Press 'Create'. Notice the required unauthenticated fields are highlighted as required.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Comment 4 Lucas Gass (lukeg) 2025-07-25 16:25:25 UTC
Created attachment 184650 [details] [review]
Bug 39773: Add 'required' attribute for required fields

Test plan, apply patch:
1) Enable ILLModule
2) Create a new OPAC request, visit:
http://localhost:8080/cgi-bin/koha/opac-illrequests.pl?op=add_form&backend=Standard
3) Press 'Create'. Notice the required 'type 'is now validated before the form is submitted.

Additional testing:
1) Enable ILLOpacUnauthenticatedRequest. Log out. Repeat 2)
2) Press 'Create'. Notice the required unauthenticated fields are highlighted as required.

Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 5 Lucas Gass (lukeg) 2025-07-25 20:38:01 UTC
Nice work everyone!

Pushed to main for 25.11
Comment 6 Paul Derscheid 2025-08-22 08:28:03 UTC
Nice work everyone!

Pushed to 25.05.x
Comment 7 Fridolin Somers 2025-09-19 09:30:47 UTC
Depends on Bug 38340 not in 24.11.x