how to seperate php generated buttons

how to seperate php generated buttons

I'm generating tables of buttons with php
  1. echo ' <td">
  2. <form action="test.php" method="POST">
  3. <input type="hidden" id="node" name="node" value="'.$fnode->{'name'}.'">
  4. <input type="hidden" id="service" name="service" value="'.$flavor.'">
  5. <input type="hidden" id="running" name="running" value="false">
  6. <input type="submit" value="OFF" class="button">
  7. </form>
  8. </td>';
I want to send the values without reloading via jquery ajax and I'm using this code for it:
  1. $(".button").click(function() {
  2.     $('.error').hide();
  3.        
  4.         var dataString = 'node='+ document.getElementById('node').value + '&service=' + document.getElementById('service').value + '&running=' + document.getElementById('running').value;
  5.              
  6.         $.ajax({
  7.             type: "POST",
  8.             url: "test.php",
  9.             data: dataString,
  10.             success: function() {
  11.                 alert ("Success");
  12.             }
  13.         });
  14.         return false;
  15.     });
Code works so far - it just always sends the data from the first form. What is the best way to distinguish between all the buttons. I could use a counter in the form, but how would I exactly write the js "ifs".
Is there a more elegant way to do this. Number of forms is dynamic.
Thank you for your time