laminas / laminas-form

Validate and display simple and complex forms, casting forms to business objects and vice versa
https://docs.laminas.dev/laminas-form/
BSD 3-Clause "New" or "Revised" License
80 stars 52 forks source link

Conditional Elements + Conditional InputFilter Feature request or documentation request if functionality already exists #16

Open weierophinney opened 4 years ago

weierophinney commented 4 years ago

Given a form that is defined as an array data structure and constructed using the factory and outputting the rendered content using the Form View Helper ... how would one go about adding in conditional elements and their respective Filters and Validators?

Sample: Regular fieldsets --> Elements / fieldsets --> Radio button ------> Option A ------------> Show the conditional fieldset / element(s) for option A. ------> Option B ------------> Show the conditional fieldset / element(s) for option B.


Originally posted by @jackdpeterson at https://github.com/zendframework/zend-form/issues/155

weierophinney commented 4 years ago

This is a more concise description of #153.


Originally posted by @jackdpeterson at https://github.com/zendframework/zend-form/issues/155#issuecomment-294192940

weierophinney commented 4 years ago

You can extend the method Form::isValid() in your form and check the data property and the values. Then manipulate the InputFilter for your needs.


Originally posted by @froschdesign at https://github.com/zendframework/zend-form/issues/155#issuecomment-298102241