Answer the question
In order to leave comments, you need to log in
Yii2 Unable to fill in subsequent fields?
Such a question, there is CRUD. For example, _form.php has three fields:
<div class="row">
<div class="col-md-4 vcenter">
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
</div>
</div>
<div class="row">
<div class="col-md-4 vcenter">
<?= $form->field($model, 'name_co')->textInput(['maxlength' => true]) ?>
</div>
</div>
<div class="row">
<div class="col-md-4 vcenter">
<?= $form->field($model, 'name_red')->textInput(['maxlength' => true]) ?>
</div>
</div>
Answer the question
In order to leave comments, you need to log in
It is not worth implementing such functionality using validators. The task of validators is to check the data for compliance with the incoming data to certain rules, and blocking form fields is the task of the form itself. Therefore, as Maxim Timofeev said , implement the functionality using js, and attach it directly to the form. You should not sculpt functionality that logically does not apply to validators on them ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question