title: How to make yii2 ActiveForm ignore previous submitted values?
body: <p>I'm trying to make a simple search form (it will grow more complex soon so I'm using an ActiveForm here instead of simply passing GET parameters to the action method).</p>
  
  <p>controller:</p>
  
  <pre><code>public function actionIndex()
  {
      $search_form = new UserSearchForm();
      $search_form-&gt;load(Yii::$app-&gt;request-&gt;get(), $formName = '');
  
      return $this-&gt;render('index', [
          'search_form' =&gt; $search_form
      ]);
  }
  </code></pre>
  
  <p>view:</p>
  
  <pre><code>&lt;?php $form = ActiveForm::begin(['id' =&gt; 'search-form', 'method' =&gt; 'get']); ?&gt;
  &lt;?= $form-&gt;field($search_form, 'q')-&gt;textInput(['name' =&gt; 'q']) ?&gt;
  &lt;?= Html::submitButton('Search') ?&gt;
  &lt;?php ActiveForm::end(); ?&gt;
  </code></pre>
  
  <p>I'm using $formName = '' in controller and 'name' => 'q' in view to make the query string cleaner (simple q instead of UserSearchForm[q]).</p>
  
  <p>Everything looks fine until first submit. I see a hidden q field in the form and after second submit the URL looks like /user?q=value1&amp;q=value2, each submit adds another q to hidden fields. Is there a good way to get rid of those hidden fields? Or maybe the whole approach is wrong? I guess I'll need hidden fields there anyway (sorting, pagination etc).</p>