This is a duplicate of the Drupal 8 issue which is marked as closed/fixed, but the problem also exists in Drupal 7.
There is a known issue with the Chosen library where it breaks this (https://github.com/harvesthq/chosen/issues/2075), which hasn't been fixed, but includes workarounds.
To reproduce, add a required multi-select field to a content type. Fill out all other required fields on the node add form. The form will not submit, but no direction is given to the user.
In Chrome, the user gets no feedback, and this error appears in the console log:
An invalid form control with name='field_test[]' is not focusable.
In Firefox, the message appears at the top of the browser window, rather than by the element:
Comment | File | Size | Author |
---|---|---|---|
#2 | chosen-fix_requied_selects-3104309-2.patch | 1.63 KB | jenlampton |
Comments
Comment #2
jenlamptonHere's a patch derived from the one applied to the Drupal 8 issue:
https://www.drupal.org/project/chosen/issues/2705891
I'm not entirely sure it's working everywhere. On FireFox validation is working, but the browser is still unable to identify which element is failing validation and places the error message at the very top of the screen. It seems to work properly on Chrome.
Comment #3
danyg CreditAttribution: danyg at Cheppers commentedThank you for the patch, it fixed the problem. For some reason the patch cannot be applied automatically (for me, but I was able to apply it manually).
Comment #4
DieterHolvoet CreditAttribution: DieterHolvoet at Minsky commented