How to conditionally require a field based on a selection in a form?

119 views Asked by At

I am using Plone and z3c.forms. There is a field at the top that selects what content object we are creating. It then shows the fields needed to build that object.

I need to be able to conditionally require fields based on what content object is selected at the top of the form. Is this possible?

enter image description here

1

There are 1 answers

2
alepisa On BEST ANSWER

It is possible; what you need is called an "invariant validator". Have a look here.