D
D
Doniyor Mamatkulov2018-06-23 18:50:45
Yii
Doniyor Mamatkulov, 2018-06-23 18:50:45

Displaying form validation error?

Hey!
I have a registration form using bootstrap like this:

<div class="row">
            <div class="col-md-3"><span class="formLhFix"><?=Yii::t('app', 'Cell phone number')?></span></div>
            <div class="col-md-4">
                <?=$form->field($cellPhoneModel, 'phone')->textInput(['placeholder'=>'+7', 'class'=>'form-control'])->hint(false)->label(false);?>
            </div>
            <div class="col-md-5 formLhFix">
                *
            </div>
        </div>

It is necessary to display the corresponding error in the field instead of an asterisk if there is a validation error for each form field. Moreover, not errorSummary, but only the error of this form field. How to implement it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2018-06-23
@D0nik

Good evening.
Approximately so
Modify the template for yourself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question