Checkboxes Over Multiple Pages

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
montecristo
Forum Newbie
Posts: 20
Joined: Thu Oct 19, 2006 9:51 am

Checkboxes Over Multiple Pages

Post 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
timclaason
Forum Commoner
Posts: 77
Joined: Tue Dec 16, 2003 9:06 am
Location: WI

Pagination

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Why not make the next/previous buttons also perform the update?
Post Reply