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:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jenlampton created an issue. See original summary.

jenlampton’s picture

Status: Active » Needs review
FileSize
1.63 KB

Here'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.

danyg’s picture

Status: Needs review » Reviewed & tested by the community

Thank 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).

DieterHolvoet’s picture