Page 1 of 1

Checkboxes Over Multiple Pages

Posted: Fri Nov 17, 2006 4:08 am
by montecristo
Hi Guys,

Any ideas on how to solve this problem?

I have a web page displaying database values in a table, using pagination, I display the result over several pages. Which works fine.

I have a "display on web " checkbox in each row which allows the user to check or uncheck. The user presses an update button at the bottom of the page which updates the database value.

My problem is, if the user ticks a few boxes on different pages, THEN presses the update button, it only updates the values on the current page. I think this happens because each time the user changes page, the checkbox array is re-initialised.

Any ideas of how to get around this? Is there away of finding out that a checkbox value has been changed and putting into some sort of global array?

Thank you for your time

Pagination

Posted: Fri Nov 17, 2006 8:48 am
by timclaason
You could do some kind of Javascript onclick for the checkboxes that sends a parameter to a PHP page, which then puts update values into a buffer table in your database. Then on the update, run a query on that buffer table, update appropriate records, then flush the buffer table.

Or you could uses SESSION[] stuff or cookies, as well.

Posted: Fri Nov 17, 2006 1:16 pm
by feyd
Why not make the next/previous buttons also perform the update?