From the issue for the Webform module:

When making a file upload element conditionally required when another field is filled or another option is chosen, the field doesn't become required.

Steps to reproduce:

1. Create a form
2. Create a radiobutton element
3. Option A and option B
4. Create a file upload element and a textfield, set them to not required
5. Through #state API, make them required when radiobutton element has Option A selected
6. Select option A and submit the form
7. The form is submitted

The states api does not update the file field required attribute.
Some example forms yml files were attached to the Webform issue.


artureiji created an issue. See original summary.

artureiji’s picture

Maxfire’s picture

Assigned: Unassigned » Maxfire

I'm going to work in this issue.

Maxfire’s picture

Assigned: Maxfire » Unassigned
amateescu’s picture

Component: field system » forms system