Validation max value in field form

Hi.

I am looking for a validator to check the max value in field forms.

I try but doesn’t work


<?= $form->field($model, 'top_name_probability')->input('number', ['min'=>0,'max'=>1]) ?>

and


<?= $form->field($model, 'top_name_probability')->textInput(['min'=>0,'max' => 1]) ?>

Put this in your model rules:


 public function rules()

    {

        return [

['top_name_probability', 'string', 'max' => 50],


.

.

.

In your View:


 <?= $form->field($model, 'top_name_probability')->textInput(['maxlength' => true]) ?>

Thank you, exactly what it was