title: technique in getting the id and pass it on ajax
body: <p>I have an ajax function that has two parameters needed to update a quantity of my item. Now I am having a trouble on how to get the <code>$product_id</code> to be pass in my ajax parameter. I don't have any technique on how can i pass the <code>$product_id</code> to supply my ajax function. 
  By the way i am using laravel.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>@foreach($products as $product)
  &lt;tr&gt;
      &lt;td class="col-sm-8 col-md-4"&gt;
      &lt;div class="media"&gt;
          &lt;a class="thumbnail pull-left" href="#"&gt; &lt;img class="media-object" src="http://icons.iconarchive.com/icons/custom-icon-design/flatastic-2/72/product-icon.png" style="width: 72px; height: 72px;"&gt; &lt;/a&gt;
          &lt;div class="media-body"&gt;
              &lt;h4 class="media-heading"&gt;&lt;a href="#"&gt;&amp;nbsp; {{ $product['item']-&gt;product_name }}&lt;/a&gt;&lt;/h4&gt;
              &lt;!-- &lt;span&gt;Status: &lt;/span&gt;&lt;span class="text-success"&gt;&amp;nbsp;&lt;strong&gt;In Stock&lt;/strong&gt;&lt;/span&gt; --&gt;
          &lt;/div&gt;
      &lt;/div&gt;&lt;/td&gt;
      &lt;td class="col-sm-1 col-md-1" style="text-align: center"&gt;
      &lt;input type="number" class="form-control" id="productqty" max="{{ $product['maxqty'] }}" min="1" value="{{ $product['qty'] }}"&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  @endforeach
  </code></pre>
  
  <p>now in my view i want to update the quantity of my item when i click the <code>input type="number"</code></p>
  
  <p>Here is my javascript :</p>
  
  <pre><code>$("#productqty").bind('keyup mouseup', function () {
      var value = $(this).val();
      updateQty(?,value);
  });
  </code></pre>
  
  <p>Here is my javascript. Now i want to get the product_id of the selected input type number. I have many products in it. How can i get my exact product_id when i click the <code>keyup mouseup</code> event in my input type that has an id of <code>$productqty</code> so that i can supply my ajax function parameter that i put a question mark in it. <code>updateQty(?,value);</code> the ? is where i want the <code>product_id</code> will be replaced.</p>