Format of Canadian postal code is different from US zip codes (so is the name, btw, we don't use term "ZIP code", proper term in Canada is "Postal Code").

Canadian Postal Code consists of two 3-character parts separated by space: [letter][digit][letter][optional space][digit][letter][digit] or "[a-zA-Z][0-9][a-zA-Z][ ]?[0-9][a-zA-Z][0-9]", for example: "R2G 1T9".

Current validation function on ZIP field allows only 5 digits. At the very least it should allow to enter 6 alphanumeric characters. At best it should allow to enter codes in any of these forms: "a1b2c3", "A1B2C3", "a1b 2c3", "A1B 2C3" (allowing mixed cases for letters), but store and display only "A1B 2C3" - all uppercase letters and show a space between two 3-character parts.

Comments

rconstantine’s picture

Assigned: Unassigned » rconstantine

fair enough. shouldn't be too much trouble. i'll add it in on my next module maintenance day (Wednesday).

Styles’s picture

Any news on this? it doesn't seem to be on any of the releases

rconstantine’s picture

This is slated to be fixed the next time I can get some time. I ran out of time last week on my module maintenance day, and this week's day was skipped due to another deadline I'm facing. However, things look good for next Wednesday. This module is number one to be fixed, followed by Accounttypes and then Fullname in that order. So I expect to make the changes on Wednesday the 2nd. Sorry it has taken so long, but from what I've seen in other modules, I'm pretty fast to respond to both bug reports and feature requests.

I'm working with Drupal full time and do have a portion of time where I can maintain what I've released, however, the overall project takes priority. I'm sure you understand. But I think you guys have been thorough in your requests to get the Canadian address stuff complete, so hopefully, all will be well after this next release. Plus, I hope that the model I've created for the Canadian address module will be able to be used by others to create other countries' addresses.

One thing I'm adding to the address module is ability to validate other languages. I'll develop a hook that will be called and then answered by each address module. So in the case of Canada, since US-English is already covered, I'll add validation for French.

Anyway, thanks for your patience.

Styles’s picture

Thanks for the info...
Very prompt!

I've done a temp fix of your module wich allows 6 characters letters/numbers, by removing the "int" field value and setting it to varchar. So I can wait a little ;-)

There are 2 more features that i would highly suggest:
Work phone/home phone fields.. cause it looks a bit strange when they are outside the cck_address box (feild group)
and the ability to add help text to the major fields...that would actually be quite important

Thanks again

rconstantine’s picture

I'm getting somewhere... http://drupal.org/node/136088

Also, I'm changing both zip and apt to varchar.

I'm also adding several characters to both US and CA validation. And CA will be able to validate English and French characters.

As for phone numbers, sorry. I'm going to do a separate module for that. However, why don't you use the 'fieldgroup' module. That's what it's for and it's what I use.

rconstantine’s picture

Status: Active » Fixed

Uploading in moments to dev.

Anonymous’s picture

Status: Fixed » Closed (fixed)