0

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.

David Weinraub
  • 14,144
  • 4
  • 42
  • 64
Daniel Del Core
  • 3,071
  • 13
  • 38
  • 52

1 Answers1

3

You just need wrap it in one more array:

'validators' => array(array('EmailAddress')),
Volvox
  • 1,639
  • 1
  • 12
  • 10