title: How to get foreach input value in javascript and pass it to ajax data?
body: <p>This is my Form</p>
  
  <pre><code>&lt;form method="post" id="BargainForm"&gt;
      &lt;input type="hidden" name="pro_id" class="pro_id" id="pro_id" value="&lt;?php echo $pro_id; ?&gt;"&gt;
      &lt;input type="hidden" name="customer_id" class="customer_id" id="customer_id" value="&lt;?php echo $customer_id; ?&gt;"&gt;
      &lt;input type="text" name="bargain_qty" class="bargain_qty" id="bargain_qty" placeholder="Qty" required/&gt;&lt;/br&gt;&lt;/br&gt;
      &lt;?php if($productType = 'Configurable'): ?&gt;
          &lt;?php foreach($attributes as $attribute): ?&gt;
              &lt;input type="text" name="&lt;?php echo strtolower($attribute['store_label']); ?&gt;" 
                                          class="&lt;?php echo strtolower($attribute['store_label']); ?&gt;" 
                                          id="&lt;?php echo strtolower($attribute['store_label']); ?&gt;" 
                                          placeholder="&lt;?php echo $attribute['store_label'] ?&gt;"&gt;&lt;/br&gt;&lt;/br&gt;
          &lt;?php endforeach; ?&gt;
      &lt;?php else: ?&gt;
  
      &lt;?php endif; ?&gt;
      &lt;input type="text" name="bargain_price" class="bargain_price" id="bargain_price" placeholder="Total Price" required/&gt;&lt;/br&gt;&lt;/br&gt;
      &lt;input type="submit" name="bargain_btn" class="bargain_btn"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Here is my javascript code</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(function () {
      $('.bargain_btn').click(function(e) {
          var qty = $( "#bargain_qty" ).val();
          var price = $( "#bargain_price" ).val();
          var pro_id = $( "#pro_id" ).val();
          var customer_id = $( "#customer_id" ).val();
          var att_lable = $( "#&lt;?php echo strtolower($attribute['store_label']); ?&gt;" ).val();
          alert(att_lable);
          e.preventDefault();
          $.ajax({
              url: "&lt;?php echo Mage::getUrl('bargain/Ajax/index'); ?&gt;",
              type: "POST",
              data: {qty,price,pro_id,customer_id},
              success: function(data) {
                  if(data.success) {
                  }
              }
          });
      });
  });
  </code></pre>
  
  <p></p>
  
  <p>In form i am using foreach. If i have 2 data so it will display 2 input tags, i just don't know how to save values of that 2 input and pass it to <code>data: {qty,price,pro_id,customer_id},</code></p>
  
  <p>Thank you in advance!</p>