is there a way i can use the Alnum filter for a Zend_Form_Element_Text form element but still retain commas ? The input will be command seperated tags for an item.
Do i have to define my own filter ? Is there a way to achieve this using the ‘Callback’ filter type ?
Expected input is tag1,tag2,tag3
$tags=new Zend_Form_Element_Text('tags');
$tags->setLabel('Tags:');
$tags->addFilters(array('Alnum','StripTags','StringTrim','HtmlEntities'));
Update 1:
the Zend_Filter_Alnum has an option to allow whitespace which can be activated by
$tags->addFilters(array('StripTags','StringTrim','HtmlEntities',new Zend_Filter_Alnum(true)));
So the expected input will be tag1 tag2 tag3 but still if anybody could suggest me a way to make it accept tag1,tag2,tag3, it would be awesome.
This is just an example , it shouldn’t be used as is in a production environment :