ZF-11159: wrong 'type' attribute on TEXTAREA for Zend_Dojo_Form_Element_SimpleTextarea
Description
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 (http://w3.org/TR/html4/…).
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;
}
Comments
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: https://github.com/zendframework/zf2/pull/307