title: Validation Form in wiget
body: <p>I would like to have a form available on every page in my web app. So I created a widget with a form.</p>
  
  <pre><code>class AddNewURL extends Widget{
  
      public $model;
  
  
      public function init()
      {
          parent::init();
          if ($this-&gt;model === null) {
              $this-&gt;model = new ProductUrlForm();
          }
      }
  
      public function run()
      {
          return $this-&gt;render('addNewURLForm', [
              'model' =&gt; $this-&gt;model,
          ]);
      }
  }
  </code></pre>
  
  <p>and widget view</p>
  
  <pre><code>&lt;div class="modal fade bs-example-modal-lg" id="newURL" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"&gt;
      &lt;div class="modal-dialog modal-lg" role="document"&gt;
  
          &lt;div class="modal-content"&gt;
              &lt;?php Pjax::begin(); ?&gt;
              &lt;?php $form = ActiveForm::begin([
                  'action' =&gt; Url::to(['site/new-url']),
                  'options' =&gt; ['data' =&gt; ['pjax' =&gt; true]],
              ]) ?&gt;
              &lt;div class="modal-header"&gt;
                  &lt;button type="button" class="close" data-dismiss="modal" aria-label="Close"&gt;&lt;span aria-hidden="true"&gt;&amp;times;&lt;/span&gt;
                  &lt;/button&gt;
                  &lt;h4 class="modal-title" id="myModalLabel"&gt;Add new URL&lt;/h4&gt;
              &lt;/div&gt;
              &lt;div class="modal-body"&gt;
                  &lt;div class="row"&gt;
                      &lt;div class="col-md-12"&gt;
                          &lt;?= $form-&gt;field($model, 'url', ['errorOptions' =&gt; ['class' =&gt; 'help-block', 'encode' =&gt; false]])
                              -&gt;textInput(['maxlength' =&gt; false])
                          ?&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="modal-footer"&gt;
                  &lt;button type="button" class="btn btn-default" data-dismiss="modal"&gt;Close&lt;/button&gt;
                  &lt;button type="submit" class="btn btn-primary"&gt;Add&lt;/button&gt;
              &lt;/div&gt;
  
              &lt;?php ActiveForm::end() ?&gt;
              &lt;?php Pjax::end(); ?&gt;
          &lt;/div&gt;
  
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and this how I use this widget in my layouts/main.php</p>
  
  <pre><code>&lt;?= \app\widgets\AddNewURL::widget() ?&gt;
  </code></pre>
  
  <p>in my <em>site/new-url</em> action I have </p>
  
  <pre><code>public function actionNewUrl()
      {
          $model = new ProductUrlForm();
          $model-&gt;status = STATUS_NEW;
  
          if ($model-&gt;load(Yii::$app-&gt;request-&gt;post()) &amp;&amp; $model-&gt;save()) {
             //return success message
          }
  
          return $this-&gt;render('index', [
              'model' =&gt; $model,
          ]);
      }
  </code></pre>
  
  <p>and now when I submit form data goes to my action, the form is reset and that's all. How to show validation error or success message using pjax? In my model I have few custom validation rules. </p>
  
  <p>Maybe there is better solution to use one form on all pages?</p>