This is the respective issue for https://www.drupal.org/project/drupal/issues/742344, a blocker for the #5346 backport, and related to #1040.
Problem/Motivation
Accessibility guidelines recommend specific, meaningful error messages when required form elements are empty. However, FAPI currently does not support custom error messages for required elements.
Proposed resolution
Support a
#required_error
property for form elements. If set, this message will be used when a required form element is empty, instead of the default "Field x is required." Additionally set a#required_but_empty
flag automatically during validation when the required field is empty. This is an internal property and is not set manually. It allows#element_validate
handlers to set a custom required error message, but without having to re-implement the complex logic to figure out whether the field value is empty.Remaining tasks
Commit feature and document these properties. The feature is a small API improvement that is applicable to both D8 and D7.
User interface changes
None.
API changes
Minor, backwards-compatible addition only. No existing code will be affected. Addition of two FAPI element properties:
#required_error
#required_but_empty
Advocate for this issue: @klonos
Recent comments
Sounds like the Stripe processor isn’t fully initialising, so the extension tries to call create() on a missing Stripe client. On Backdrop/CiviCRM this usually happens when the payment processor...
Getting Error after submitting event register form By using Stripe Payment Processor
Welcome to Backdrop! For your setup, you’ll want to create a subtheme of Bootstrap5 Lite itself; the Bootswatch styles (like Cerulean) are just presets that B5 Lite loads, and you can “lock in”...
Basic Theme designing questions, using Bootstrap5 Lite
Hi Rob, Welcome to Backdrop! Here’s a quick overview: Subtheming Bootswatch: You should create your subtheme based on Bootstrap5 Lite, not directly on a Bootswatch style....
Basic Theme designing questions, using Bootstrap5 Lite