#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    16
    Rep Power
    0
    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!

    -Ray
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    London/UK
    Posts
    91
    Rep Power
    14
    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

    sorted...

    Bealers


    ------------------
    http://back-end.org
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Posts
    16
    Rep Power
    0
    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!

    -Ray

Similar Threads

  1. Dynamic Forms - How do I add Combo Boxes on the fly
    By assemblage in forum PHP Development
    Replies: 0
    Last Post: February 5th, 2004, 02:44 PM
  2. help submitting 2 forms, one with dynamic list box...
    By ralphuk100 in forum HTML Programming
    Replies: 4
    Last Post: February 3rd, 2004, 08:24 AM
  3. Dynamic Forms on Pocket IE
    By HarryJ in forum HTML Programming
    Replies: 0
    Last Post: January 15th, 2004, 11:56 AM
  4. Dynamic forms
    By cadmus75 in forum HTML Programming
    Replies: 0
    Last Post: September 4th, 2003, 02:36 PM
  5. Processing forms with dynamically named input items
    By PFunk in forum ASP Programming
    Replies: 2
    Last Post: August 28th, 2003, 10:50 PM

IMN logo majestic logo threadwatch logo seochat tools logo