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

Issue Type: Patch Created: 2011-03-10T08:05:51.000+0000 Last Updated: 2011-08-01T13:46:25.000+0000 Status: Resolved Fix version(s): - 1.11.6 (05/May/11)

Reporter: Guillaume ORIOL (goriol) Assignee: Martijn Swaagman (swaagie) Tags: - Zend_Dojo

Related issues: Attachments: - Zend_Dojo_View_Helper_SimpleTextarea.patch


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):

<pre class="highlight">
    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;


Posted by Martijn Swaagman (swaagie) on 2011-04-25T06:27:40.000+0000

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

Posted by Adam Lundrigan (adamlundrigan) on 2011-04-30T06:56:16.000+0000

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

Posted by Guillaume ORIOL (goriol) on 2011-05-02T13:56:37.000+0000

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.

Posted by Matthew Weier O'Phinney (matthew) on 2011-05-02T19:21:27.000+0000

Agreed. Patch applied to trunk and 1.11 release branch.

Posted by Robert Basic (robertbasic) on 2011-08-01T13:46:25.000+0000

Pull request for porting the patch in ZF2 is sent:

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.