Skip to content

Instantly share code, notes, and snippets.

@apipkin
Created February 25, 2010 17:35
Show Gist options
  • Save apipkin/314789 to your computer and use it in GitHub Desktop.
Save apipkin/314789 to your computer and use it in GitHub Desktop.
<?php
$this->addElement(new Zend_Form_Element_Text('phone_number'));
$this->getElement('phone_number')
->setLabel('Phone Number')
->setRequired(true)
->addValidator('StringLength',false, 10)
->addValidator('Regex',false, array('/^[+]?[-\d() .]*$/i', 'message'=>'Please provide a valid Phone Number.'))
->setErrorMessages(array(''))
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment