$name = new Zend_Form_Element_Text('name'); $name->setLabel('Name:') ->setRequired(true) ->addValidator('NotEmpty', true) ->addFilter('StripTags') ->addFilter('StringTrim');
$email = new Zend_Form_Element_Text('email'); $email->setLabel('Email:') ->setRequired(true) ->addValidator('EmailAddress', true, array( 'messages' => array( Zend_Validate_EmailAddress::INVALID => 'Invalid email address' ) )) ->addFilter('StripTags') ->addFilter('StringTrim');Package library: Zend_Form, part of the Zend Framework.