title: How to make the data available for all the rows in a table
body: <p>My problem is the fetching is correctly works on first row</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
    $(document).ready(function () {
          $("#tb3").on('input change', function () {
  
              $('#tb3 &gt; tbody  &gt; tr').each(function () {
                  var code = $(this).find('#Product_Code').val();
                  //var data = $("#tb3 tr:eq(1)").clone(true).appendTo("#tb3");
                  //var code = data.find("Product_Code").val('');
  
  
                  $.ajax({
                      type: "POST",
                      url: "&lt;?php echo base_url();?&gt;TipUp_Loan/fetch",
                      data: {
                          code: code
                      },
                      datatype: 'json',
                      success: function (data) {
  
  
                          var json = data,
                              obj = JSON.parse(json);
  
  
                          $("#Product_Name").val(obj.itemname);
                          $("#Rate").val(obj.salrate);
                          //alert(obj);
  
  
                      }
                  });
              });
          });
      });
  &lt;/script&gt;
  </code></pre>
  
  <p>table code:</p>
  
  <pre><code>&lt;table&gt;
      &lt;thead&gt;
          &lt;tr&gt;
              &lt;th&gt;&lt;a href="javascript:void(0);" id="multi" name="multiplerows" title="Add More Person"&gt;&lt;/a&gt;&lt;/th&gt;
              &lt;th&gt;Product Code&lt;/th&gt;
              &lt;th&gt;Product Name&lt;/th&gt;
              &lt;th&gt;Qty&lt;/th&gt;
              &lt;th&gt;Rate&lt;/th&gt;
              &lt;th&gt;Amount&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
          &lt;tr &gt;
              &lt;td&gt;&lt;a href='javascript:void(0);' class='remove3'&gt;&lt;span class='glyphicon glyphicon-remove'&gt;&lt;/span&gt;&lt;/a&gt;&lt;/td&gt;
              &lt;td&gt;
                  &lt;input style="width:80px" type="text" id="Product_Code"  class="form-control input-xs Product_Code "  onkeyup="fetch()"  name="Product_Code[]" required&gt;
              &lt;/td&gt;
              &lt;td &gt;&lt;input style="width:300px" type="text" id="Product_Name" class="form-control input-xs" name = "Prdtname[]"   &gt; &lt;/td&gt;
              &lt;!--value="&lt;?php echo $row['Product_Name']; ?&gt;"--&gt;
              &lt;td&gt;&lt;input style="width:80px" type="text" id="Qty" onkeyup="movetoNext(this, 'addMore3')" class="form-control input-xs"   name="Qty[]" required&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input style="width:100px" type="text" id="Rate"  class="form-control input-xs" value="" name="rate[]" required&gt;&lt;/td&gt;
              &lt;td&gt;&lt;input style="width:150px" type="text" id="Value" class="form-control input-xs" name="amount[]" &gt;&lt;/td&gt;
              &lt;th&gt;&lt;a href="javascript:void(0);" id="addMore3" name= addmore title="Add More Person"&gt;&lt;span class="glyphicon glyphicon-plus"&gt;&lt;/span&gt;&lt;/a&gt;&lt;/th&gt;
          &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p>Fetch code:</p>
  
  <pre><code>public function fetch()
  {   
      $this-&gt;load-&gt;model('User_model');
      $result = $this-&gt;User_model-&gt;fetch_name($_POST["code"]);
  
      echo json_encode($result);
      //echo 'hello'.$code;
  }
  </code></pre>
  
  <p>Model code:</p>
  
  <pre><code>public function fetch_name($code)
  {
      $query = $this-&gt;db-&gt;query("select * FROM itemmaster where itcode = $code")-&gt;row_array();
  
      return $query;
  }
  </code></pre>
  
  <p>I am trying to fetch the product details by product code when the user hits tab key..what i have to alter to make the fetching available to all the rows of a table..Thanks in advance</p>