I have one field in my big form.
<?= $form->field($model, 'name')->textInput(['maxlength' => 255]) ?>
The following is the configuration of ActiveForm settings:
<?php
$form = ActiveForm::begin([
'enableClientValidation' => true,
'options' => [
'enctype' => 'multipart/form-data',
]
]);
?>
I want to implement a unique client-side validation for this. I use a unique validator for it, but it only works for server-side validation.
public function rules() {
return [
[['name'], 'unique'],
]
...
other validations
...
};
Other checks are functional, but a unique client-side check does not work.
source
share