BR (www.br-design.pl) Zend Components
This is a growing library of quality components for Zend Framework 1.11 build during some commercial projects.
This Action Helper together with little JavaScript plugin by Jan Jarfalk called "Limit" is the solution for displaying how much characters left for user to type into form input element until he will reach set limit by default \Zend_Validate_StringLength validator (exactly it's max option). Plugin will setup a description field next to Your element that will update dynamically as user types characters in field.
It's very easy to use.
Remember to register namespace of the plugin inside Your bootstrap like so:
Zend_Controller_Action_HelperBroker::addPrefix('Br_Controller_Action_Helper_');
And then, inside of action just invoke the plugin like so:
$this->_helper->LimitChars(array(
$form->getElement('about'),
$form->getElement('equipment'),
), $this->view);
First argument is array of the \Zend_Form_Elements You want to initialize the plugin on, second argument is currently used view (for appending JavaScript).
- Helper will append it's text to description field on Your element if You have defined them.
- You need to have headScript helper invoked in Your view to add necessary JavaScript file