formsplonez3c.form

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


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


Solution

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