Question

I'm looking for form validation syntax for an Email address in array notation.

This is what i have currently.

 $this->addElement('text', 'email', array(
    'placeholder' => 'email address',
    'required' => true,
    'filters' => array(
        array('name', 'StringTags'),
        arary('name', 'StringTrim'),
    ),
    'validators' => array('EmailAddress')
 ));

Any help would be greatly appreciated.

Cheers, Daniel.

Was it helpful?

Solution

You just need wrap it in one more array:

'validators' => array(array('EmailAddress')),
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top