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

The "Postal Code" field only accepts Zip codes. #98

Closed
Dale-WAX opened this issue Jun 2, 2016 · 3 comments
Closed

The "Postal Code" field only accepts Zip codes. #98

Dale-WAX opened this issue Jun 2, 2016 · 3 comments

Comments

@Dale-WAX
Copy link

Dale-WAX commented Jun 2, 2016

The Postal Code Field will only accept numbers like a zip code. When entering a letter, like in a Postal Code, the validation errors out.

90210 = OK / T3E 2H6 = Error

@muskie9
Copy link
Member

muskie9 commented Jun 2, 2016

Hi @Dale-WAX, thanks for pointing this out. The Postal Code regex is actually set in the silverstripe-australia/silverstripe-addressable module, however, you should be able to set a custom regex via your _config/config.yml file per their config checking here. Your config might look something like:

Addressable:
  set_postcode_regex: 'your_regex_here'

Alternatively, you should be able to do the followingin your _config.php: Config::inst()->update('Addressable', 'set_postcode_regex', 'your_regex_here');.

@Dale-WAX
Copy link
Author

Dale-WAX commented Jun 2, 2016

Thanks for the advice, @muskie9. I tried a few ways as you suggested, but honestly it's over my head. I'm going to do some googling tomorrow based off of your advice.

@Dale-WAX
Copy link
Author

Dale-WAX commented Jun 2, 2016

Slept on it and got it working. Thanks again.

@Dale-WAX Dale-WAX closed this as completed Jun 2, 2016
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

No branches or pull requests

2 participants