Answer the question
In order to leave comments, you need to log in
Change error class in yii2 field?
The default field is a div block with the class "has-error" or "has-access", how can I change these classes?
<div class="form-group field-post-title required has-error">
<label class="control-label" for="post-title">Title</label>
<input type="text" id="post-title" class="form-control" name="Post[title]" aria-required="true" aria-invalid="true">
<div class="help-block">Title cannot be blank.</div>
</div>
Answer the question
In order to leave comments, you need to log in
\yii\widgets\ActiveForm::begin([
'errorCssClass' => 'my-css-class'
]);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question