addElement( 'text', 'url', array( 'label' => 'Job URL', 'validators' => array('Url'), 'description' => 'Example: http://www.adaptainc.com', ) ); $this->addElement('textarea', 'brief', array('label' => 'Brief Description', 'required' => true)); $length = (int)$this->getConfig('briefLength'); if ($length) { $lengthValidator = new \Zend_Validate_StringLength(0, $length); $lengthValidator->setMessage( "Brief Description is less than %min% characters long", \Zend_Validate_StringLength::TOO_SHORT ); $lengthValidator->setMessage( "Brief Description is more than %max% characters long", \Zend_Validate_StringLength::TOO_LONG ); $this->getElement('brief')->setAttrib('maxlength', $length); $this->getElement('brief')->addValidator($lengthValidator); $description = 'Text space is limited to ' . $length . ' characters'; $this->getElement('brief')->setOptions(array('description' => $description)); } $this->addElement( 'htmlEditor', 'description', array( 'label' => 'Job Description', 'required' => true, 'toolbar' => 'BasicNoUpload', 'hasMsWordNote' => true ) ); $this->addElement( 'htmlEditor', 'apply', array('label' => 'How to Apply', 'required' => true, 'toolbar' => 'BasicNoUpload', 'hasMsWordNote' => true) ); return $this; } }