I have my form code like this below
function __construct($controller, $name) {
$fields = new FieldSet(
new TextField('Name', 'name', 'first','20'),
new EmailField('Email', 'Email address', '', '100'),
new TextField('Phone', 'Phone number','','20'),
);
$actions = new FieldSet(new FormAction("login", "Log in"));
$validator = new RequiredFields('Name', 'Email');
parent::__construct($controller, $name, $fields, $actions, $validator);
}
I want to add more vilification for this form.
I want to add phone# vilification.
How and where I can add vilification code to do that and show an error message to form(view file) if there is error from phone number?
thanks