Answer the question
In order to leave comments, you need to log in
How to tell ActiveForm which script to use for client-side validation?
There are several fields in the form, which, depending on the status of the record, are either required or not. But the form, not knowing this, requires them constantly.
Answer the question
In order to leave comments, you need to log in
The script cannot be defined in ActiveForm. it is picked up from the model that is used.
Accordingly, in order for ActiveForm to pull up the necessary validation rules, you need to install a script for the model used, for example:$model->scenario = 'my-scenario';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question