Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Some might ask if a select field should ever show an error because something is always selected. The answer is yes for two reasons that I can think of:
1) If a selection conflicts with another piece of data on the form
2) If the select element has a default value of something like "-Please Choose-" which is not a valid choice
Patch attached. I found it weird that the select element doesn't have any class attribute but this patch does not address that issue.
Comment | File | Size | Author |
---|---|---|---|
select_error.patch | 1.43 KB | Steve Dondley | |
Comments
Comment #1
chx CreditAttribution: chx commentedsimple but good and needed. vry unlikely to conflict w/ anything.
Comment #2
Dries CreditAttribution: Dries commentedAgreed. Committed.
Comment #3
(not verified) CreditAttribution: commented