Mobile numbers:
I can add 021123456, and 02112345678, but not 0211234567
Free phone numbers
I can add 080012345 and 0800123456 and 080012345678, but not 08001234567
I thought it was something to do with models/person.php, but am not sure now. It looks to me as though it should the numbers correctly. But I'm a bit rusty on these things
![Smile :-)](./images/smilies/icon_e_smile.gif)
Code: Select all
if ($this->data[$this->alias]['addr_country'] == 'New Zealand') {
$this->validate['addr_postalcode']['postal'] = array(
'rule' => array('postal', '/^[0-9]{4}/', 'nz'),
'message' => 'You must enter a valid New Zealand postal code',
);
$this->validate['home_phone']['phone']['rule'] = $this->validate['work_phone']['phone']['rule'] =
$this->validate['mobile_phone']['phone']['rule'] = $this->validate['alternate_work_phone']['phone']['rule'] =
$this->validate['alternate_mobile_phone']['phone']['rule'] = array('phone', '/^((03|04|06|07|09)\d{7})|((021|022|026|027|028|029)\d{6,8})|((0508|0800|0900)\d{5,8})$/');
}
This seems to stop it happening.
Code: Select all
$this->validate['alternate_mobile_phone']['phone']['rule'] = array('phone', '/(^(03|04|06|07|09)\d{7}$|^(021|022|026|027|028|029)\d{6,8}$|^(0508|0800|0900)\d{5,8}$)/');
![Sad :-(](./images/smilies/icon_e_sad.gif)