开发者

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.


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.


I think you might need to remove the validators for the hidden fields (by calling clearValidators()) before calling isValid().

There is a similar question here: Zend form validation . You might get some inspiration from the answers.

Hope it helps,

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜