title: JQuery ajax send one form from many by click on checkbox
body: <p>I am generating a form with phpClass:</p>
  
  <pre><code>   &lt;`div id='admin_users' class=''&gt;&lt;h1&gt;Felhasználók&lt;/h1&gt;
  &lt;table id='admin_user'&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;user_name&lt;/th&gt;&lt;th&gt;user_email&lt;/th&gt;&lt;th&gt;reg_time&lt;/th&gt;&lt;th&gt;activate time&lt;/th&gt;&lt;th&gt;admin&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt;
  &lt;tr&gt;
  &lt;form&gt;
  &lt;td&gt;123123&lt;/td&gt;
  &lt;td&gt;n**********ng@gmail.com&lt;/td&gt;
  &lt;td&gt;2014-01-01 23:13:58&lt;/td&gt;
  &lt;td&gt;2014-01-02 23:14:02&lt;/td&gt;
  &lt;td&gt;&lt;input type='checkbox' checked='checked' id='admin' class='admin' name='admin'  value='47' /&gt;&lt;/td&gt;&lt;input type='hidden' id='user_id' name='user_id' value='47' /&gt;
  &lt;/form&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;form&gt;
  &lt;td&gt;Gabesz80&lt;/td&gt;
  &lt;td&gt;n***********ng@gmail.com&lt;/td&gt;
  &lt;td&gt;2013-12-30 12:46:26&lt;/td&gt;
  &lt;td&gt;2013-12-30 17:40:03&lt;/td&gt;
  &lt;td&gt;&lt;input type='checkbox' checked='checked' id='admin' class='admin' name='admin'  value='48' /&gt;
  &lt;/td&gt;&lt;input type='hidden' id='user_id' name='user_id' value='48' /&gt;
  &lt;/form&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/div&gt;`
  
  
  
  echo "&lt;tr&gt;&lt;form&gt;";
      echo "&lt;td&gt;".$q-&gt;user_name."&lt;/td&gt;";
      echo "&lt;td&gt;".$q-&gt;user_email."&lt;/td&gt;";
      echo "&lt;td&gt;".$q-&gt;reg_time."&lt;/td&gt;";
      echo "&lt;td&gt;".$q-&gt;activate_time."&lt;/td&gt;";
      if($q-&gt;admin==1){
          echo "&lt;td&gt;&lt;input type='checkbox' checked='checked' id='admin' class='admin'
   name='admin'  /&gt;&lt;/td&gt;";
      }
      else {
          echo "&lt;td&gt;&lt;input type='checkbox' id='admin' class='admin' name='admin' /&gt;&lt;/td&gt;";
      }
          echo "&lt;input type='hidden' id='user_id' name='user_id' value='".$q-&gt;user_id."' /&gt;";
  
      echo "&lt;/form&gt;&lt;/tr&gt;";
  </code></pre>
  
  <p>The Jquery:</p>
  
  <pre><code>   $(':checkbox').click(function( event ) {
  
  
          $.ajax({
              type: "POST",
              url: "admin_process.php",
              data: { admin : $(this).val(),
                  user_id :  $('#user_id').val()  }
              }).done(function( msg ){
              alert("Az adatok: " + msg);     
          });
  </code></pre>
  
  <p>And the PHP:</p>
  
  <pre><code> &lt;?php
  
  if(isset($_POST)){
      echo   $_POST['user_id'] ;
      echo   $_POST['admin'] ;
  }
  
  ?&gt;
  </code></pre>
  
  <p>I try to select the next(), find(), $('#user_id') but I can't send to PHP the user_id of the line where I click. It always gives me back the id of the first line.
  I have a user list, user name, email, admin (checkbox). 
  When the user on the backend clicks on the checkbox, the AJAX should send a post to which updates the database admin cell from 1 to 0.
  In my example have two users. When I send the data with the click it always send the data of the first line.</p>