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 there a way to do this in a Callback validator?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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
$contextin a custom validator to access the rest of the submitted form data.