Josh Birdwell
Josh Birdwell

Reputation: 745

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

Upvotes: 2

Views: 123

Answers (1)

alepisa
alepisa

Reputation: 1324

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

Upvotes: 1

Related Questions