title: Update row by clicking a Edit button in CodeIgniter
body: <p>I have a table where all the data are showing  and in every row there is an edit button . Now what I want is after I click on the edit button a pop up/model box/lightbox whatever you say will appear without the page refresh and then all fields will appear on that box . I know how to do update in controller and model .I just don't know how I attach a following row id to delete button and then send to the controller through ajax and then populate them in the lightbox this is what I am doing.</p>
  
  <p>Here is my view:</p>
  
  <pre><code>   &lt;?php foreach($records as $row){?&gt;
  &lt;tr&gt;
  &lt;td&gt;
      &lt;td&gt;&lt;?php echo $row-&gt;cat_name; ?&gt;&lt;/td&gt;
      &lt;td&gt;&lt;?php $row-&gt;cat_id;?&gt; &lt;a toggle="modal"  href="#myModal"id="edit"&gt;Edit&lt;/a&gt;
  
         &lt;a  data-toggle="modal" href="#myModal"&gt;Delete&lt;/a&gt;
  
         &lt;div class="modal hide" id="myModal"&gt;  
  </code></pre>
  
  <p>Just tell me how can  send the cat_id through ajax to controller  because in ajax we grab the value through 'id' but here how can I give id to this line. </p>
  
  <pre><code>       &lt;?php $row-&gt;cat_id;?&gt; 
  </code></pre>
  
  <p>Which is behind the edit button.                        </p>