By gr8cms on
Hi there,
I've a form with some field + a file field (attachment).
When I submit it, it does well.
Now, I'm going to require it, but when i add ('#required' => TRUE,) and submit this form
"attachment field is required." will be shown.
please help me how can i solve it.
Comments
The form api 'file' cannot be
The form api 'file' cannot be set to required. However, if you use the upload element module, it gives you a new form API element that will let you upload files by ajax, and can be set to required.
Contact me to contract me for D7 -> D10/11 migrations.