By default Zend Form Text elements don\'t have a width specified. Textarea elements have a default of rows="24"
and cols="80"
. But
Using the setAttrib will not affect the stringlength as that attribute is only recognised by text inputs. Try using a validator to control the string length. Note you can also set custom error messages.
$text = new Zend_Form_Element_Textarea( 'body' );
$text-> ->setLabel('Body:')
->setAttrib('cols', 50)
->setAttrib('rows', 4)
->addValidator('StringLength', false, array(40, 250))
->setRequired( true )
->setErrorMessages(array('Text must be between 40 and 250 characters'));