title: How to get checked checkbox and associated text box value in an array and append this value to url using jquery or javascript
body: <p>In my scenario there is a list of items, check box and quantity field text box is assigned to each item. What i want to achieve is to get all checked check box and associated quantity field text box value in an array and append it to url.</p>
  
  <p>Need to pass these values in below mentioned url</p>
  
  <p>shopping.sandbox.netsuite.com/app/site/backend/additemtocart.nl?c=4030365&amp;n=1&amp;buyid=multi&amp;multi=checkboxvalue,quantityvalue;checkboxvalue,quantityvalue; etc</p>
  
  <p>This is my html code</p>
  
  <blockquote>
  <pre><code>&lt;a href="" onclick="javascript:addURL(this);alert(this.href);" id="ct1"&gt;Add to cart&lt;/a&gt; 
  &lt;div class="cell-checkbox"&gt;
  &lt;input type="checkbox" name="select" value="    
  &lt;%=getCurrentAttribute('item','internalid')%&gt;" class="big"&gt;
  &lt;/div&gt;
  &lt;div class="cell-cart"&gt;
  &lt;input name="qty" id="qty" value="1" class="input"&gt;
  &lt;/div&gt;          
  </code></pre>
  </blockquote>
  
  <p>using &lt;%=getCurrentAttribute('item','internalid')%> i'm getting checkbox value.
  on clicking add to cart anchor tag below mentioned script is executing.</p>
  
  <p>What i have tried so far</p>
  
  <pre><code>&lt;script&gt;
  function addURL(element)
  {     
  var qtyvalue = document.getElementById("qty").value;
  var val = [];  
  $(':checkbox:checked').each(function(i)
  {          
  val[i] = $(this).val();
  $('#ct1').attr('href','http://shopping.sandbox.netsuite.com/app/site/backend/additemtocart.nl?c=4030365&amp;n=1&amp;buyid=multi&amp;multi='+val[i]+','+qtyvalue);
  });
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>But its adding only single check box and quantity field value to url not entire array.I want to add these values in format something like this </p>
  
  <p>checkboxvalue,quantityvalue;checkboxvalue,quantityvalue;etc</p>
  
  <p>I am new to java script and jquery so need help to figure this out.</p>