title: Appending custom value in form data before submitting
body: <p>I want to add custom parameters to the form before submitting it. This is to retain the current filters.</p>
  <p>I have the following and it's not working. I've also tried $(&quot;#search-form&quot;).submit(formData); but it's throwing error.</p>
  <pre class="lang-js prettyprint-override"><code>$(&quot;.jump-to-page&quot;).on('keyup', function (e) {
    var formData = $('#search-form').serialize();
    if (e.key === 'Enter' || e.keyCode === 13) {
      formData += &quot;&amp;page=&quot; + $(this).val();
      $(&quot;#search-form&quot;).submit();
    }
  });
  </code></pre>
  <p>HTML:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;form class=&quot;pb-0&quot; id=&quot;search-form&quot; action=&quot;/tickets&quot; method=&quot;GET&quot;&gt;
    &lt;div class=&quot;row&quot;&gt;
      &lt;div class=&quot;col-sm-3&quot;&gt;
        &lt;div&gt;&lt;label&gt;Keyword&lt;/label&gt;&lt;/div&gt;
        &lt;input class=&quot;form-control mb-3&quot; type=&quot;text&quot; name=&quot;keyword&quot; value=&quot;{{ app('request')-&gt;input('keyword') }}&quot; placeholder=&quot;Search by title or code&quot;/&gt;
      &lt;/div&gt;
      &lt;div class=&quot;col-sm-3&quot;&gt;
        &lt;div&gt;&lt;label&gt;Type&lt;/label&gt;&lt;/div&gt;
        &lt;select class=&quot;form-control mb-3&quot; name=&quot;type&quot;&gt;
          &lt;option value=&quot;&quot;&gt;-- None --&lt;/option&gt;
          @foreach($modelInstance-&gt;getSupportTicketTypeList() as $item)
            &lt;option value=&quot;{{ $item-&gt;id }}&quot; {{ $item-&gt;id == app('request')-&gt;input('type')  ? 'selected':'' }}&gt;{{ $item-&gt;name }}&lt;/option&gt;
          @endforeach
        &lt;/select&gt;
      &lt;/div&gt;
  </code></pre>
  <p>Expected URL must be mysite.com/mypage?keyword=&amp;type=&amp;page=3</p>
  <p>CAME UP WITH THIS SOLUTION:</p>
  <pre><code>$(&quot;.jump-to-page&quot;).on('keyup', function (e) {
      var formData = $('#search-form');
      var input = '&lt;input type=&quot;hidden&quot; name=&quot;page&quot; value=&quot;'+$(this).val()+'&quot;/&gt;';
      if (e.key === 'Enter' || e.keyCode === 13) {
          formData.append(input);
          $(&quot;#search-form&quot;).submit();
      }
  });
  </code></pre>