title: How to add checkboxes values of different names to the URL in Javascript?
body: <p>I have check boxes with different names under different side-menus but having same name under each side-menu. Example:</p>
  
  <pre><code>&lt;?php for($i=0; $i&lt;=5; $i++){?&gt;
      &lt;input type="checkbox" name="second[]" value="&lt;?php echo $i + 10;?&gt;" id="&lt;?php echo $i;?&gt;"&gt;&lt;?php echo $i+10;?&gt;&lt;br&gt;
  &lt;?php } 
  
      for($j=123; $j&lt;=129; $j++){?&gt;
      &lt;input type="checkbox" name="third[]" value="&lt;?php echo $j+10;?&gt;" id="&lt;?php echo $j;?&gt;"&gt;&lt;?php echo $j+10;?&gt;&lt;br&gt;
      &lt;?php } ?&gt;
  
      for($k=223; $k&lt;=259; $k++){?&gt;
      &lt;input type="checkbox" name="fourth[]" value="&lt;?php echo $k + 10;?&gt;" id="&lt;?php echo $k;?&gt;"&gt;&lt;?php echo $k+10;?&gt;&lt;br&gt;
      &lt;?php } ?&gt;
  </code></pre>
  
  <p>I want to get the values of the checked check boxes in the URL in the form of string with their values printed after their respective name when once checked. </p>
  
  <p>URL should be like: <a href="http://something.com/?name1=value1+value2+value3&amp;name2=value1(of" rel="nofollow noreferrer">http://something.com/?name1=value1+value2+value3&amp;name2=value1(of</a> second name)+value2+value3&amp;name3=and so on...</p>
  
  <p><strong>Whenever a checkbox is clicked with a different name its value must be added in the string after its corresponding name only in the URL.
  Have to code this using Javascript/JQuery and can use bit of PHP also in JS.</strong> Thanks</p>