ZF-5292: CLONE -value of button is empty

Issue Type: Bug Created: 2008-12-16T23:55:34.000+0000 Last Updated: 2010-04-05T04:55:24.000+0000 Status: Closed Fix version(s): Reporter: Piotr ( Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Form

Related issues: - ZF-5056



I don't know why the code was added in the file,but the value of button always is empty.

file: library\Zend\Form\Decorator\ViewHelper.php :197


            if (stristr($type, 'button')) {
                $element->content = $element->getLabel();
                return null;


IT is my first issue to be reported so please forgive me for any faults I make Bug description:

Due to the above code tags in a form seem always have empty values. So isChecked() method always returns false since it uses getValue() method (Zend_Form_Element_Submit line 89). It does not matter if we escape the label or not.

I have the following button creation code. I wanted to check which button was clicked but neither $form->buttonSSL->isChecked() nor $form->button->isChecked() work. I made it working after putting manually (firebug) into rendered page into tags the following strings 'value="Send"' or ''value="Send using SSL"'. But they are not escaped!

    $button = $this->addElement('button', 'button',array(
    'decorators' => $this->_buttonElementDecorator,

    $buttonSSL = $this->addElement('button', 'buttonSSL',array(
    'label'=>'<span><em>Send using SSL</em></span>',
    'decorators' => $this->_buttonElementDecorator,



Posted by Christian Albrecht (alab) on 2010-04-05T04:55:24.000+0000

Closing this now, as this is > 1 year old, and the intention of this issue is very unclear to me. Prevent escaping is handled in ZF-9400, and the issues title is handled in ZF-5056.

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.