Re: FN-FORUM: PHP version of ASP datagrid?
date posted 21st May 2007 13:00
On 21 May 2007, at 12:48 pm, Duncan Glendinning wrote:
> if you have several checkboxes all called uid with the values set to
> their ids, then the value of uid will be the last one listed on the
> page, not a CSV or an array...
>
> If I can get around this, then it is doable.
> I am wondering whether I also pass the submitted form the query that
> displayed all the results, and then get a loop to work through all the
> results again, checking to see if the checkbox (whose name is the
> current id of the record I am looking at ) is set to 1 for example,
> and then construct the query that way.
Hi Duncan,
This is how I implement it to create a "remove" checkbox for a list of
items
Use the item id as the index and create an array like this:
When the user submits the form, $remove will be an array containing an
element for each item that the user ticked, and the index of each
element is the id .
Just loop through the array updating your table as you go.
Hope this helps.
Best regards,
Ray
------------------------------
Ray McGinty Information Design
Specialising in web application development,
e-commerce and design for print.
http://www.rmid.co.uk
Listed on the Business Link North East England Service Provider Register