// create a text input field with a filter to trim whitespace $name = new Zend_Form_Element_Text('name'); $name->setLabel('Name:') ->addFilter('StripTags') ->addFilter('StringTrim');
// create a text input field with a filter to sanitize input $email = new Zend_Form_Element_Text('email'); $email->setLabel('Email:') ->addValidator('EmailAddress') ->addFilter('StripTags') ->addFilter('StringTrim') ->addFilter('StripNewlines');These examples demonstrate the use of the addFilter method to add filters to the input value, such as StripTags, StringTrim, and StripNewlines. The Zend_Form_Element_Text class is part of the Zend_Form package library in the Zend Framework.