In an easyform I want to make a field required unless a (dropdown) field has a specific value. Is there (now) a better way than adding my own javascript? Is there som 'pat' I can use (in the XML fields model)?
what about using 2 fields that depends on the dropdown? You can show one of them at the time, one required and the other not.
Or use the global validation, maybe the best solution?
Making a field (un)required depending on a value of another field cannot be handled by easyform OOTB ... the pat-depends
implementation is only for field visibility depending on another fields value. You could use that trick to display/hide the field unless a checkbock is clicked or a select field has a specific value.
See GitHub - collective/collective.easyform: Forms for Plone and Depends — Patterns
So hidden but required would trigger the validation anyway. Thanks!
Am I missing something here? In 'Advanced' I dont see this option (but there is something in 'Overrides')
Oh, conditional field support was introduced in 4.1.0
which targets Plone 6 only.