August 14th, 2000, 06:14 PM
Ok, I'm stumped on how to best do this.
I have several ways that I can do it but seems messy to me so I'm asking for any help on this.
I have a form that is generated with the result of a query, each row returned from the query is
used in the form and a checkbox is added. I want the user to check off multiple records to be
modified and process the form.
I have a line that generates the form like so:
print "<tr><td>$id</td><td>$action</td><td>$request_dt</td><td><input type=checkbox name=request$id></td></tr>n";
I want to be able to loop through and get the $id and $action and perform my query actions for that
record and move on. I know I have seen this used in many web sites but have never needed to do it myself.
I have toyed with using REs to get the $id from the name and process it but seems to me there must be a better way.
Thanks in advance for any advice!
August 14th, 2000, 07:24 PM
refer to your checkbox like so:
<input type=checkbox name=request value="<? print $id; ?>">
this infers that the var is an array so when you come to do your processing you can simply loop thru the vals in $request to get your id
August 14th, 2000, 08:25 PM
Hey, thanks. I had tried that and did not get it to work, but just figured out I needed the quotes around the value to get it to work right. Thanks for the reply!