title: How to get input hidden value from multiple forms?
body: <p>I am having unlimited multiple dynamic forms containing only single input hidden field having submit button and trying to get the value of that form whose button is clicked. I don't know why this is not happening.</p>
  
  <p>I've read these <a href="https://stackoverflow.com/questions/16144018/how-to-get-the-specific-form-field-value-using-jquery">How to get the Specific Form Field value using JQuery</a> and <a href="https://stackoverflow.com/questions/16321252/submit-a-specific-form-with-jquery-ajax">Submit a specific form with JQuery Ajax</a> but still no result.</p>
  
  <p><strong>controller</strong></p>
  
  <pre><code>public function order()
      {
          $data['fruits'] = $this-&gt;catering_model-&gt;getrecess('Recess Fruits','Category Recess');
  
          $this-&gt;load-&gt;view('ChoiceLaunch/order',$data);
      }   
  </code></pre>
  
  <p><strong>order.php</strong></p>
  
  <pre><code>  &lt;?php $i=0;
              if(!empty($fruits)){
                          ?&gt;
                &lt;div class="col-sm-12"&gt;&lt;h3 align="center"&gt;&lt;?php echo $fruits[0]-&gt;catsubname; ?&gt;&lt;/h3&gt;&lt;br&gt;
                                          &lt;!-- while($res_item=mysqli_fetch_array($cat_item_sql)){ --&gt;
                    &lt;?php $i=0;
                      foreach($fruits as $lrd1){ 
                          $i++;                   
                    ?&gt;
                     &lt;form method="post" action=""&gt;
  
                      &lt;div class="col-sm-4 col-md-3"&gt;
                              &lt;div class="thumbnail"&gt;
                                &lt;a href="&lt;?php echo base_url(); ?&gt;Choice/orderdetial"&gt;&lt;img style="height: 177px;width: 200px;" src="&lt;?php echo 'http://localhost:8080/catering/uploads/'.$lrd1-&gt;picturename;?&gt;" alt="..."&gt;&lt;/a&gt;
                                &lt;div class="caption protitle"&gt;
                                  &lt;a href="#"&gt;&lt;p style="height: 12px;width: 200px;margin-top: 9px;margin-bottom:29px;"&gt;&lt;?php echo $lrd1-&gt;itemname; ?&gt;&lt;/p&gt;&lt;/a&gt;&lt;br&gt; 
  
                                  &lt;input type="hidden" name="quantity" id="quantity&lt;?php echo $i;?&gt;" value="&lt;?php echo $lrd1-&gt;itemname; ?&gt;" size="2"&gt;
                                  &lt;button type="submit" id="send" class="btn btn-info"&gt;Add To Order&lt;/button&gt;&lt;br&gt;
                                  &lt;?php echo '$'.$lrd1-&gt;price; ?&gt;
  
                                &lt;/div&gt;
                              &lt;/div&gt;
                            &lt;/div&gt;
                              &lt;?php
                          }}
                              ?&gt;
                            &lt;/form&gt;
  
  
  
                   &lt;/div&gt;
  &lt;script&gt;
  $('#send').click(function(){
    //var selection= $(this).attr('id'); 
  
  // $( "[id='quantity']" ) .each(function(){
       // alert($(this).val());
  // }); //running bt showing all at once
  
  
  $( "form:input[type=hidden]" ) .each(function(){
       alert($(this).val());
  })
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>I am using CodeIgniter.</p>