Conditional validation

Hey guys,

Would it be possible to have some kind of conditional validation? To make fields required when another fields has been filled.

E.g. We offer a user to show/hide a CTA on the frontend through the CMS. This means that when the copy and URL of that CTA is filled we will display a CTA on the frontend with that custom copy and URL. This means both fields have to be filled out or both have to be left blank.

Currently it looks like this is not possible. Are there any plans to support something like this?

Laravel for example has some nice rules available for this scenario and many others offering full flexibility:
required_with, required_with_all, required_if, required_unless (make sure to check out the other validation rules over there as well, they’re solid!)

Use the plugin?

Hey guillome, thanks for the suggestion!

We do use the plugin but unfortunately that does not solve the validation issue. If we would make all conditional fields required and they are hidden the form can never be saved since it will never pass validation. :slightly_frowning_face:
That specific issue was discussed in this topic as well, but I would like to have conditional validation in both hidden and visible fields.

Please share any other thoughts you might have, thanks!