I don't know for certain if this is actually part of the Address Field module. But documentation page (http://drupal.org/node/1267288) states " There are current issues to fix the address formatting and validation for several countries. Please test for your country."

However (at least for the Netherlands) no validation seems to be done on the postal code. Dutch postal codes are alway 4 numbers followed by 2 letters. User can however input whatever they like. It doesn't look like there is any validation done at all.

Is this how the module is supposed to work?
And if so, does anybody know of a (n alternate) way to achieve this?

Comments

liam morland’s picture

The Postal Code Validation module could help with this.

liam morland’s picture

Category: support » feature
firfin’s picture

Status: Active » Closed (works as designed)

Ok, thanks for your reply. Does that module play nice with address field?

I solved the problem by inplementing hook_form_alter() for the forms that had the address field. I gather address field module will not be validating postal codes.

Changing status accordingly.

liam morland’s picture

The Postal Code Validation module could be used by the Address Field module to do validation. Some code would need to be added to Address Field. Postal Code Validation by itself just provides the validate function and the validation rules for many countries.

I think it is a valid feature request to add validation to Address Field.

liam morland’s picture

Status: Closed (works as designed) » Active

Marking #1814522: Support for address field module? as duplicate of this.

firfin’s picture

Ok, guess it is not happening then. As I understand it, the address field module maintainers are interested in one thing and one thing only: supplying an xnal standard compliant address field.

liam morland’s picture

If so, there are probably hooks that could be used by another module to connect together Address Field with Postal Code Validation.

g089h515r806’s picture

try field_validation_postal_code_validator in field validation(http://drupal.org/project/field_validation ) module. it fix this issue.

liam morland’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

shaneonabike’s picture

Could we put some documentation on the main project page about this.. it's super not clear and later only realized by searching through the issue queue? Using postal code validation is great but requires code to put in a hook and such... You could even reference this ticket if you like?

Thanks

shaneonabike’s picture

Status: Closed (fixed) » Needs work
rszrama’s picture

Issue summary: View changes
Status: Needs work » Closed (fixed)

I've listed that module under the compatibility notes.