Re: Processing a table of input fields

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Use name="attend[<?php echo $user_id?>]"

This will simplify life immensely on the processing side where you can
just iterate through $_POST['attend'] as an array and have the
$user_id.

Ditto for the pay[<?php echo $user_id?>] and other fields.

Note that the checkboxes will ONLY send in keys/values for the checked
ones -- You get nothing for the unchecked ones -- which is fine, you
assume they weren't there if they weren't checked.

On Fri, May 11, 2007 1:22 pm, Todd Cary wrote:
> I create a table of input fields so the user (secretary at a
> Rotary meeting) can check mark if the person attended and how
> much they paid for lunch.  Each input field name has the user ID
> as part of it.  What is the best way to process the table when
> the submit button is pressed?  There are about 50 rows in the table.
>
> Sample of one row for member 590:
>
> <tr>
> <td><input type="checkbox" name="590_attend" value="1">
> </td>
> <td>05/11/2007</td><td>Theressa</td><td>Bryant</td><td><input
> type="text" name="590_pay" value="16" size="5" maxlength="4"></td>
> <td><input type="text" name="590_charge" value="16" size="5"
> maxlength="4"></td>
> <td><input type="text" name="590_note"" size="26"
> maxlength="25"></td>
> </tr>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux