开发者

Zend Validate PostCode in a Zend Form -> Validate depending on given country

How can I validate a zipcode field in my form depending on the country set in the "country" field in the same form?

I somehow need to get access to the form instance or the value of another field. Is t开发者_JAVA技巧here a way to do this in a Callback validator?


Check out the "Validation Context" note on this page - http://framework.zend.com/manual/en/zend.form.elements.html (no direct link, just Ctrl+F Validation Context)

You can use the $context in a custom validator to access the rest of the submitted form data.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜