ZF-11159: wrong 'type' attribute on TEXTAREA for Zend_Dojo_Form_Element_SimpleTextarea


I just noticed the Zend_Dojo_Form_Element_SimpleTextarea element is not properly rendered by its view helper. A 'type' attribute is added in contradiction with the HTML 4 specification (…).

I would suggest removing the commented line in the following code from the view helper (Zend_Dojo_View_Helper_SimpleTextarea):

    public function simpleTextarea($id, $value = null, array $params = array(), array $attribs = array())
        if (!array_key_exists('id', $attribs)) {
            $attribs['id']    = $id;
        $attribs['name']  = $id;
        $attribs['type']  = $this->_elementType; // <= REMOVE THIS LINE

        $attribs = $this->_prepareDijit($attribs, $params, 'textarea');

        $html = '_htmlAttribs($attribs) . '>'
              . $this->view->escape($value)
              . "\n";

        return $html;


Agree with the solution of the orginal poster, all tests run, file attached

Is there any case where this change in behavior would break an existing application?

I don't see any as this attribute is not allowed by the HTML specification. Furthermore, any use of this unexpected attribute would be erroneous.

Agreed. Patch applied to trunk and 1.11 release branch.

Pull request for porting the patch in ZF2 is sent: