title: Get value of hidden fields
body: <p>I'm trying to fetch the value of hidden fields in form when update_qty is changed with an on change event. Form is generated by php loop and presents one row from DB. I need to fetch update_qty with onchange event and also get all the hidden fields of the updated row.</p>
  
  <p>Below is code I'm using, can you please point me to the right direction? I can't get it to work. I always get values in hidden fields from the first row.</p>
  
  <pre><code>//This form is dynamiclly genrated buy php loop. All input fields are one row from DB. 
  
  &lt;form name="form1" id="form1" method="POST" action="update_qty.php"&gt;
  &lt;input type="text" name="update_qty" class="update_qty" id="qty" value="&lt;?php echo $sales_value['qty'] ?&gt;"&gt;&lt;?php echo ' Kom'; ?&gt;
  &lt;input type="hidden" name="article_id" id="article_id" value="&lt;?php echo $sales_value['article_id']; ?&gt;"&gt;
  &lt;input type="hidden" name="sales_plan_id" id="sales_plan_id" value="&lt;?php echo $sales_plan_id; ?&gt;"&gt;
  &lt;input type="hidden" name="product_mix_id" id="product_mix_id" value="&lt;?php echo $product_mix_id; ?&gt;"&gt;
  &lt;/form&gt;
  
      //Update qty on article
  $(document).ready(function() {
  
      $('.update_qty').on('change', function() {
  
          var message = prompt("Upišite razlog za izmjenu količine:");
          alert(message);
          //e.preventDefault();
          var article_id = $("#article_id").val();
          var sales_plan_id = $("#sales_plan_id").val();
          var update_qty = $(this).val();
          var product_mix_id = $("#product_mix_id").val();
  
  
          if (message != "" || message != NULL) {
              $.ajax({
                  type:'POST',
                  url:'update_qty.php',
                  data:{ article_id: article_id, sales_plan_id: sales_plan_id, update_qty: update_qty, product_mix_id: product_mix_id, message: message },
                  success:function(data) {
                      alert(data);
                  }
              });
          } else {
              e.PreventDefault();
              return false;
          }
  
      });
  
  });
  </code></pre>