like this in my model I have required fields

public function rules() { return [ [['user_id', 'city_id', 'payment',], 'required'], ['street', 'required', 'message' => 'Укажите название улицы.'], ... } 

this way I organize the work with the form

 <div class="col-xs-12 col-sm-4"> <div class="form-group"> <?= Html::activeLabel($model,'street'); ?> <?= Html::activeInput('text',$model,'street',['class'=>'form-control']) ?> </div> </div> 

Actually, the whole question is how you can mark the required fields when using activeinput , given that these fields are mandatory in the model. Use Activeform is not possible

    1 answer 1

    You can add the html attribute required for the fields that must be required in your form

    <?= Html::activeInput('text',$model,'street',['class'=>'form-control', 'required' => true]) ?>

    • did not help. Sending all the same happened - Sergalas