ZF-2845: Zend_View_Helper_FormReset doesn't allow for disabled

Issue Type: Bug Created: 2008-03-10T12:54:25.000+0000 Last Updated: 2008-05-05T11:44:41.000+0000 Status: Resolved Fix version(s): - 1.5.2 (15/May/08)

Reporter: James Scherer (jscherer26) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_View

Related issues: Attachments:


Zend_View_Helper_FormReset doesn't allow for being disabled. It is commented with //always enabled

but I'm not sure why. Another odd comment in Zend_View_Helper_FormSubmit: says // ignore disable/enable, always show the button.

but allows for disable. So that comment should be removed. The following would take care of Zend_View_Helper_FormReset:

<pre class="highlight">
   public function formReset($name = '', $value = 'Reset', $attribs = null)
        $info = $this->_getInfo($name, $value, $attribs);
        extract($info); // name, value, attribs, options, listsep, disable

        $xhtml = 'view->escape($value) . '"';

        // add if disable
        if ($disable) {
            $xhtml .= ' disabled="disabled"';

        // add attributes, close, and return
        $xhtml .= $this->_htmlAttribs($attribs) . ' />';
        return $xhtml;

I assume that would be sufficient in the current code.

All of the Zend_View_Helper_? in respect to disabling needs to be addressed. The overall scheme seems to want to disable based on seeing the attribs['disable'] key while disregarding any corresponding value. This is an issue if you disable all the elements in a form and then later wish to enable an individual element. Also, Zend_View_Helper_FormElement has some disable code in _getInfo that seems to complicate things unnecessarily.


Posted by Matthew Weier O'Phinney (matthew) on 2008-04-22T11:17:03.000+0000

Scheduling for next mini release.

Posted by Matthew Weier O'Phinney (matthew) on 2008-05-02T12:17:13.000+0000

Resolved in trunk and 1.5 release branch

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.