Issues

ZF-8475: Dojo form button can't submit a value

Issue Type: Bug Created: 2009-12-04T14:21:08.000+0000 Last Updated: 2009-12-05T07:06:11.000+0000 Status: Resolved Fix version(s): Reporter: boris (jer) Assignee: Matthew Weier O'Phinney (matthew) Tags: - Zend_Dojo

Related issues: - ZF-5056

Attachments:

Description

this bug is related to this one http://framework.zend.com/issues/browse/ZF-5056. But for Zend_Form there is a workaround - just to use Zend_Form_Element_Submit instead of Zend_Form_Element_Button, for Zend_Dojo_Form_Element_Button there is no alternative

<pre class="highlight">
$form = new Zend_Dojo_Form()
$form->setMethod('post')
$button = new Zend_Dojo_Form_Button(
    'Save',
    array(              
        'label'     => 'Save',
        'id'        => 'id',
        'type'      => 'Submit',
        'value'     => 'Save',
    )
);
$form->addElement($button);
$form->populate($_POST);

$form->getElement('Save')->isChecked();

isChecked() will never return true (tested FF, IE8, Chrome, Safari, Opera), because value attribute of button is always empty due to the way Zend_Form_Decorator_ViewHelper works (it just never gives button a value attribute!)

Comments

Posted by Matthew Weier O'Phinney (matthew) on 2009-12-05T07:05:47.000+0000

Use Zend_Dojo_Form_SubmitButton if you need a submittable dijit.form.Button, or provide an onclick callback that submits the button: ``` $button = new Zend_Dojo_Form_Button( 'Save', array(
'label' => 'Save', 'id' => 'id', 'type' => 'Submit', 'value' => 'Save', 'onclick' => 'dijit.byId("formid").submit()', ) ); {note}

Have you found an issue?

See the Overview section for more details.

Copyright

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

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

Contacts