Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include postal code example per country/subdivision #127

Open
3 tasks
Etroid opened this issue May 19, 2019 · 5 comments · May be fixed by #128
Open
3 tasks

Include postal code example per country/subdivision #127

Etroid opened this issue May 19, 2019 · 5 comments · May be fixed by #128

Comments

@Etroid
Copy link

Etroid commented May 19, 2019

Problem/Motivation

There are many scenarios in which the postal code validation return ambiguous error messages. It might be useful to provide some additional context through a valid example. Google provides a list of valid postal code examples under the zipex property. As a first step to improve postal code validation, we would need to include this property in the addressing resources.

Example

What's involved:

  • Update generate_address_data.php to include zipex on both country and subdivision level
  • Add property postalCodeExample to AddressFormat class
  • ?

Related: #31

@Etroid Etroid linked a pull request May 19, 2019 that will close this issue
2 tasks
@jamessampford
Copy link

I think this would be a great addition as this will show an example as to what was expected by the validator

@bojanz
Copy link
Contributor

bojanz commented Oct 15, 2020

I need to resolve #147 first because if we give up on subdivision-level postal code validation, then we don't need postal code examples on that level either.

@BenWalters
Copy link

@bojanz since #147 is now 'resolved' is there an appetite to implement the examples at country level?

@bojanz
Copy link
Contributor

bojanz commented Dec 2, 2021

@BenWalters
Yes, let's circle back to this. I think we need a new PR though.

@damienmckenna
Copy link

damienmckenna commented Jun 30, 2023

Just ran into this with the following values from El Salvador:

  • 1101
  • CP1101

Both failed validation, but both are "shorthand" for the postal code, and in both cases it gave the vague "Postal code field is not in the right format." message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants