Guest User

Phone Number Validation

a guest
Sep 27th, 2014
314
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $phone = new Text("phone" , array("class" => "form-control"));
  2. $phone->setLabel("Phone Number");
  3. $phone->addValidators(array(
  4.     new PresenceOf(array(
  5.         "message" => "Please fill in this number",
  6.     )),
  7.     new ExclusionIn(array(
  8.         'message' => 'Number already registered',
  9.         "domain" => $phone_list,
  10.     )),
  11. ));
RAW Paste Data