Closed (fixed)
Project:
Postal Code Validation
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
14 Dec 2012 at 18:40 UTC
Updated:
31 Dec 2012 at 18:50 UTC
Please add support for Swiss:
<?php
/**
* @file
* Postal code validation functions for Swiss.
*/
/**
* Implements _postal_code_validation_validate_COUNTRYCODE().
*/
function _postal_code_validation_validate_CH($postal_code) {
$return = array('country' => 'CH');
if (preg_match('/^[0-9]{4}$/', $postal_code)) {
$return['postal_code'] = $postal_code;
}
else {
$return['error'] = 'Invalid postal code. Postal codes in Swiss are like "9999".';
}
return $return;
}
Comments
Comment #1
liam morlandFixed in 9b21f7c. Danke!