T
T
Timur2013-01-03 13:14:48
Yii
Timur, 2013-01-03 13:14:48

Yii: dynamic nested forms. Is it possible to?

Please tell me, is it possible to "cross" the form builder and dynamically created forms through jquery?
I have a project creation form, and a project can have many specializations. Currently I have such a code (under the spoiler)
Code

return array(
    'elements'=>array(
        'project'=>array(
            'type'=>'form',
            'title'=>'Заголовок и описание',
            'elements'=>array(
                'caption'=>array(
                    'type'=>'text',
                ),
                'description'=>array(
                    'type'=>'textarea',
                ),
            ),
        ),

        'areas'=>array(
            'type'=>'form',
            'title'=>'Требуемые специализации',
            'elements'=>array(
                'areaID'=>array(
                    'type'=>'dropdownlist',
                    'items'=>ListAreas::getDropDownList(),
                    'prompt'=>'Выберите специализацию',
                ),
            ),
        ),
    ),

    'buttons'=>array(
        'register'=>array(
            'type'=>'submit',
            'label'=>'Создать проект',
        ),
    ),
);

But the problem is that I need to add specializations dynamically. How to do it? Nothing of the sort could be found. Is it possible?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
Timur, 2013-01-03
@XAKEPEHOK

The question is gone. It is forbidden

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question