Zend Framework 2 Forms Array notation for drop down onchange event

二次信任 提交于 2019-12-06 16:07:32

问题


I am using Zend Framework 2 Forms using array notion for a select (drop down box). Code snippet from MenuForm.php is below:

 $options_for_select = $menuTable->GetParents();
    $this->add(array(
        'type' => 'Zend\Form\Element\Select',
        'name' => 'parent',
        'attributes' => array(
            'options' => $options_for_select,
        ),
        'options' => array(
            'label' => 'Select parent item',
            ),
        )
    );

When this drop down changes I would like to populate another drop down list on the form with a list of options that are related to the item selected in the parent drop down list.

How can I achieve this?

Thank you.

来源:https://stackoverflow.com/questions/16225697/zend-framework-2-forms-array-notation-for-drop-down-onchange-event

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!