S
S
Sergey2015-03-02 20:57:48
Yii
Sergey, 2015-03-02 20:57:48

How to build a complex form in yii2?

I need to make a form in which when selecting / entering different values, it changes.
Those. something appears, something leaves other fields of the form.
I haven't started doing it yet, but I've already run into difficulties.
1. I plan to hide/show form fields separately with a jquery script. Or is there another way, which is provided by the framework itself?
2. If in the model I describe the fields that are required. Hiding them out of sight on jquery, without receiving these values, the server will swear, how to get around, add your values ​​to the script, then filter them in the controller? isn't that a crutch?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-03-02
@butteff

Or is there another way, which is provided by the framework itself?

Yii is supposed to solve problems related to the backend. Nothing more. For complex forms, you can use knockout.js and the like.
The organization of the validation of these data is another story. You have validation groups, etc. You can write your own validators, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question