title: Yii2 Implement client side unique validation for input field
body: <p>I've one field in my big form i.e.</p>
  
  <pre><code>&lt;?= $form-&gt;field($model, 'name')-&gt;textInput(['maxlength' =&gt; 255]) ?&gt;
  </code></pre>
  
  <p>Following is my ActiveForm options configuration:</p>
  
  <pre><code>&lt;?php
  $form = ActiveForm::begin([
              //'id' =&gt; 'printerForm',                
              'enableClientValidation' =&gt; true,
              'options' =&gt; [
                  'enctype' =&gt; 'multipart/form-data',
              ]
  ]);
  ?&gt;
  </code></pre>
  
  <p>I want to implement client side unique validation for this. I'm using unique validator for it but its only working for server side validation.</p>
  
  <pre><code>public function rules() {
          return [
       [['name'], 'unique'],
  ]
  ...
  other validations
  ...
  };
  </code></pre>
  
  <p>Other validations working perfectly but unique client side validation is not working.</p>