how to create list of people with Yes/No radio buttons for each, then process form

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • NotGiven

    how to create list of people with Yes/No radio buttons for each, then process form

    I have a database result set with names, IDfield and a Y/N field.

    How do I create the radio buttons that can then be processed easily using an
    array (I assume) with an easy-to-loop-through structure?

    The form would look like:

    Joe Smith O[Y] O[N]
    Karen Smith O[Y] O[N]
    ....

    Any ideas are appreciated!


  • larry@portcommodore.com

    #2
    Re: how to create list of people with Yes/No radio buttons for each, then process form

    That's more code than I want to write here also your form structure
    would probably differ from mine, but I can say you got the general idea
    there. Here is a general idea of how the code goes:

    General structure would be
    read in the data...
    - set counter to 0
    - select the records
    - loop through the record with mysql_fetch_arr ay
    - - increment counter
    - - Read in record ID, Name and Yes/No response to thier respective
    arrays (i.e. $name[] = $items['name']; $recordid =
    $items['recordid'];)

    Display the HTML, (inside use a PHP script to create the inputs)
    - Using a loop read in the array values as inputs up to the counter
    - - for input names use the array ID (i.e. ..name="name[]"> )
    - (don't forget to include the array counter and the record ID array
    as 'hidden' values.)
    - submit

    Reading back in the submitted form
    - read through arrays
    - - Do SQL updates with array data

    Hope that helps!

    Larry

    Comment

    • NotGiven

      #3
      Re: how to create list of people with Yes/No radio buttons for each, then process form

      many thanks!


      <larry@portcomm odore.com> wrote in message
      news:1135048720 .160910.91840@g 49g2000cwa.goog legroups.com...[color=blue]
      > That's more code than I want to write here also your form structure
      > would probably differ from mine, but I can say you got the general idea
      > there. Here is a general idea of how the code goes:
      >
      > General structure would be
      > read in the data...
      > - set counter to 0
      > - select the records
      > - loop through the record with mysql_fetch_arr ay
      > - - increment counter
      > - - Read in record ID, Name and Yes/No response to thier respective
      > arrays (i.e. $name[] = $items['name']; $recordid =
      > $items['recordid'];)
      >
      > Display the HTML, (inside use a PHP script to create the inputs)
      > - Using a loop read in the array values as inputs up to the counter
      > - - for input names use the array ID (i.e. ..name="name[]"> )
      > - (don't forget to include the array counter and the record ID array
      > as 'hidden' values.)
      > - submit
      >
      > Reading back in the submitted form
      > - read through arrays
      > - - Do SQL updates with array data
      >
      > Hope that helps!
      >
      > Larry
      >[/color]


      Comment

      Working...