British postcodes do much more than speed the mail.They play a vital role in many applications, especially in fields such as mapping, transportation, marketing and statistics.You can access it by purchasing specialized software, but that's a costly option.However, it's relatively easy to check the syntax of a postcode.Hello, I am trying to validate a postcode based on what State is selected. In my form before the postcode is entered they need to select a state.If the postcode they entered doesn't match the state then I want to field to go red, and green if its correct.
The outward code includes the postcode area and the postcode district.
The inward code includes the postcode sector and the postcode unit.
Examples of postcodes include “SW1W 0NY”, “PO16 7GZ”, “GU16 7HF”, or “L1 8JQ”.
I can easy work around this worry though by simply creating my own extension of Zend_Validate_Post Code, so that's what I did: library/App/Validate/Post Code.php: And of course, with the benefit of ZF's plugin loader system, once I'm happy that the bug is fixed in Zend_Validate_Post Code, I'll be able to just remove my override and Zend_Form will carry on working.
By Mike Lewis If your database contains UK address data, it's especially important that the postcodes are correctly stored.