I'm trying to use a text link "Approve" to pass a user_id variable.
What I'm doing:
A list of names is generated from the DB. Next to each name is an "Approve" text link. At the top of the page is a text box where the individual who is approving the people on the list can specify a Batch ID# with which each record is "stamped" when it is approved.
I almost have this working, but for one problem...
When the approve link is clicked, it needs to pass two variables to the next page
1) The content of the BATCH ID text field
2) The user id# that is pulled from the DB when the list of names is generated
Everything works except that when it passes the user id#, it is passing the ID# of the LAST person on the list of names rather than the one that is clicked on.
Example
NAME-------------ID#--------------APPROVAL
Jon----------------1--------------Approve (text link)
Chris--------------2--------------Appove (text link)
Mark--------------3--------------Approve (text link)
If I click on Approve next to Chris (user id = 2), it is passing the variable ($reg_id) #3 instead (the last one on the list)
End Example
Code follows:
<input type=\"hidden\" name=\"register_id\" value=\"$reg_id\">
<a href=\"javascript:document.batch_id.submit();\">Approve</a>