title: Yii2: how to make bootstrap tab active if there is any yii2 error
body: <p>I have create a <code>CRUD</code> using <code>Yii2</code>.
  Now i have added <code>multi-tab</code> using <code>bootstrap</code> 
  <a href="http://getbootstrap.com/javascript/#tabs-examples" rel="nofollow noreferrer">http://getbootstrap.com/javascript/#tabs-examples</a></p>
  
  <p>Now i have some validation rule on field like <code>required validation</code>.
  when save button is click then it shows error on active tab but if there is any error on inactive tab then it will not submit the form.
  if there is any error in active tab user will correct them by doing proper action, but he will not understand that there is any error on other tabs as well.</p>
  
  <p>So what i want if there is any error in other tab then that tab will become active.</p>
  
  <p>and if user remove all validation error at active tab then try to re-submit the form then it will again move to next error containing tab.</p>
  
  <p>here is my code of form</p>
  
  <pre><code> &lt;?php $form = ActiveForm::begin(); ?&gt;
      &lt;div class="nav-tabs-horizontal"&gt;
      &lt;ul class="nav nav-tabs nav-tabs-line" data-plugin="nav-tabs" role="tablist"&gt;
      &lt;li class="active" role="presentation"&gt;&lt;a data-toggle="tab" href="#user" arria-controls="user" role="tab"&gt;User Details&lt;/a&gt;&lt;/li&gt;
      &lt;li role="presentation"&gt;&lt;a data-toggle="tab" href="#company" aria-controls="company" role="tab"&gt;Company Details&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
  
   &lt;div class="tab-content"&gt;
  
       &lt;div class="tab-pane active" id="user" role="tabpanel"&gt;
           &lt;div class="form-group form-material"&gt;`  
              &lt;?= $form-&gt;field($model, 'first_name')-&gt;textInput(['placeholder'=&gt;'First Name']); ?&gt;
              &lt;/div&gt;
                &lt;div class="form-group form-material"&gt;
                &lt;?= $form-&gt;field($model, 'last_name')-&gt;textInput(['placeholder'=&gt;'Last Name']); ?&gt;
                &lt;/div&gt;
                &lt;div class="form-group form-material"&gt;
                  &lt;?= $form-&gt;field($model, 'email')-&gt;input('email'); ?&gt;
                  &lt;/div&gt;
                  &lt;div class="form-group form-material"&gt;
                 &lt;?= $form-&gt;field($model, 'password')-&gt;passwordInput(['placeholder'=&gt;'Password']);?&gt; 
                  &lt;/div&gt;
                    &lt;div class="form-group form-material"&gt;
                   &lt;?= $form-&gt;field($model, 'repeatpassword')-&gt;passwordInput(['placeholder'=&gt;'Repeat Password']);?&gt;
                  &lt;/div&gt; 
  
        &lt;/div&gt;
  
        &lt;div class="tab-pane" id="company" role="tabpanel"&gt;
  
         &lt;div class="form-group form-material"&gt;
          &lt;?= $form-&gt;field($company, 'Title')-&gt;textInput(['maxlength' =&gt; true]); ?&gt;
          &lt;/div&gt;
  
               &lt;div class="form-group form-material"&gt;
              &lt;?= $form-&gt;field($company, 'Website')-&gt;textInput(['maxlength' =&gt; true]); ?&gt;
               &lt;/div&gt;
  
  
                &lt;div class="form-group form-material"&gt;
                    &lt;?= $form-&gt;field($company, 'Description')-&gt;textarea(['rows' =&gt; 6]); ?&gt;
                 &lt;/div&gt;
  
                  &lt;div class="form-group form-material"&gt;
                  &lt;?= $form-&gt;field($company, 'Status')-&gt;dropDownList(['Active' =&gt;'Active','Deactive'=&gt;'Deactive','Pending'=&gt;'Pending'],['prompt'=&gt;'']) ?&gt;
                    &lt;/div&gt;
            &lt;/div&gt;
       &lt;/div&gt;
  
        &lt;?= Html::submitButton("Save", ["class" =&gt; "btn btn-success"]); ?&gt;
     &lt;/div&gt;
     &lt;?php ActiveForm::end(); ?&gt;
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/4s3gj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4s3gj.png" alt="enter image description here"></a></p>