title: Dynamically change Form Action when form submitting
body: <pre><code>&lt;form method='GET' name='search' action='index.php'&gt; 
      &lt;input type="hidden" name="searchType" value="all" /&gt;
      &lt;input type="checkbox" name="vehicle" value="first"/&gt; 
      &lt;input type="checkbox" name="vehicle" value="second" checked/&gt; 
  &lt;/form&gt;
  
  &lt;a href="javascript:document.search.submit()"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>From the form above, I want the URL data to be <code>index.php/searchType=all</code> when first checkbox is checked and URL data to be <code>index.php/</code> (to be empty) if second checkbox is checked. How am I going to do that? Is it possible to on or off the "hidden" parameter as the example above? I don't want it to be <code>index.php/searchType=</code> when second checkbox is checked but to remove the whole parameter name.</p>
  
  <hr>
  
  <p>This is second question:</p>
  
  <p>I want to inject some parameters in the Form Action, how could I do that? Is it looked something like this:</p>
  
  <pre><code>&lt;a href="javascript:injectParameter();document.search.submit()"&gt;&lt;/a&gt;
  </code></pre>
  
  <p>What am I supposed to write in the injectParameter() method?</p>
  
  <p>Sorry about I am quite new in Javascript and web.</p>