Active
Project:
CCK Address Extensions
Version:
5.x-1.x-dev
Component:
Other
Priority:
Critical
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
19 Jan 2008 at 08:07 UTC
Updated:
19 Sep 2008 at 20:19 UTC
Jump to comment: Most recent file
Comments
Comment #1
rconstantine commentedThis is how you do it. So thanks for the post. Currently, releases are on freeze because of a problem with the CVS directory for this project. But I will review it and if everything checks out, I will include it. Otherwise, I'll post changes that need to be made here if I don't have time to take care of them myself.
Comment #2
wheatbix commentedSorry, I just realised that the postcode (zip) was not validating correctly.
As I am very new to PHP I just fudged it in the newly attached files to make sure any symbols are not included. However it would be good if it would validate a 4 (four) digit zip.
See attached files for the update that makes it (kind of) work.
Comment #3
rastarr commentedNice to see other Aussies using Drupal :)
Look forward to the Aust states being added too - well done.
Comment #4
rconstantine commentedIf you do an google search for "Australia postal code regex" or something like that, you'll probably find what your regex should be for the zip. Are your digits all numbers, are all values possible in each column? Those are the kinds of things your regex should take into account for validation. I still haven't gotten around to looking at your code yet. Am I to understand from comment #3 that there aren't states (territories or whatever you call them in Australia) in your module as it is now?
Comment #5
msielskirconstantine: It appears the territories are included here.
whea:
This regex will require 4 digits:
[0-9]{4}and I've made line 108:
if (($item['zip'] != '') && (!preg_match("/^[0-9]{4}$/", $item['zip']))) {Thanks for your work on this! If I make any other changes I will post a patch.
- Matt