开发者

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

开发者 https://www.devze.com 2023-03-06 04:31 出处:网络
How can I validate a zipcode field in my form depending on the country set in the \"country\" field in the same form?

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

精彩评论

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