looping through hidden fields within a php while loop that are in a table row
<p>How do I know which hidden field I should fetch a value from given a button clicked that is adjacent to the hidden fields. this button is also in the while loop hence giving rise to a list of buttons and hidden fields. each button has a hidden field adjacent to it.</p>

<p>I want to use jquery ajax to insert data from the hidden field into a table in the DB but wen i loop through all the buttons to find out which one is clicked, it works well but the problem comes in wen i loop through the hidden fields, it gets the value of the last hidden field. How do i get the value of the hidden field just adjacent to the button that was clicked?
I will really appreciate the help. Thanx in advance.</p>

<pre><code>&lt;Table id="list_tb"&gt;
&lt;?php
while($rows=mysql_fetch_assoc(orderSQL))
{
?&gt;
&lt;tr&gt;
&lt;td&gt;&lt;?php echo $rows['name'];?&gt;&lt;/td&gt;
&lt;td&gt;
&lt;form&gt;
&lt;input type="submit" name="add_btn" id="add_btn" value="Add"/&gt;
&lt;input type="hidden" name="order_id" id="order_id" value="&lt;?php echo $rows['order_id'];?&gt;"/&gt;
&lt;/form
&lt;/td&gt;
&lt;/tr&gt;
&lt;?php
}
?&gt;
&lt;/Table&gt;
</code></pre>

<p>THE JQUERY</p>

<pre><code>$(#list_tb input[type=submit]).each(function(){
$(this).click(function(){
$(#list_tb input[type=hidden]).each(function(){
var value=$(this).val();
alert(value);
});
});
});
</code></pre>
