>-----Original Message-----
>From: Jason G. [mailto:[EMAIL PROTECTED]]
>Sent: 03 October 2001 12:12
>Subject: Re: [PHP-DB] Check Boxes/UPDATE
>Assuming that you have a variable number of records being displayed out of
>the database:
>As you write out the HTML, give each checkbox a name containing the ID# of
>the record that is being written out.  Ex:
><input type="check" name="chkAuthStatus_1203" checked>
><input type="check" name="chkAuthStatus_1204" checked>
><input type="check" name="chkAuthStatus_1205" checked>

Note that you can use arrays when naming your form elements -- isn't PHP
wonderful :). Thus you can have:

  <input type="check" name="chkAuthStatus[0]" checked>
  <input type="check" name="chkAuthStatus[1]" checked>
  <input type="check" name="chkAuthStatus[2]" checked> ...etc

This simplifies the code somewhat as you can now loop through the elements
of the array $chkAuthStatus to find out whether it is checked or not.

Jason Wong
Gremlins Associates
Tel: +852-2573-5033
Fax: +852-2573-5851

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to