Search code examples
zend-frameworkzend-form-element

Disable Zend Form Element validation if hidden


I have a few elements in my zend form that are sometime hidden via javascript.

I would like to disable their validations if they are hidden, so the form will be valid.

Any way to do it in the server side? or in the element settings?

Thanks.


Solution

  • Depending on the situation, you could at the same time disable the hidden items. Thus they won't be posted and you could then use isValidPartial that only validates the fields that are send in parameter.