2

Is there a way to make fields conditionally required?

Example of fields

I have a toggle field that is used to hide or show a section (see screenshot: "Section 3 enabled"). If the section is shown (toggle: on), the fields need to be filled. If the section is hidden (toggle: off), the fields can be left empty. Note that the section's fields can be of any type (text, matrix, entry, assets, ...).

I already tried the plugin Reasons, and unfortunately it's not what I need because it will still return a validation error for the hidden but required fields.

My Craft CMS version is 2.6.2983.

1

There is currently not a native way to do this in Craft. You should consider adding a thumbs-up/comment to this feature request if you'd like to see it, though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.