Page 1 of 1

Checkboxes & Pagination

Posted: Sun Jun 19, 2005 12:18 am
by spartan7
Hi, I have hit a problem. I have a dynamically generated results page (from a search) where a user can select a number of options via checkboxes, which then pass on to the next page where they can email (based what they select on the checkboxes)...My problem is as follows, I have 25 results per page (It can go over 1000 in all for some searches) and each time I click "Next" to paginate the previous pages checkbox results are cleared. How do I maintain the checkbox values (and their checked status) from page to page during pagination so that all selections over all the pages can be passed onto the email form?

Thanks (Im a newbie don't hurt me)

Posted: Sun Jun 19, 2005 12:21 am
by hawleyjr
Pass the checkbox values from page to page via sessions.

Code: Select all

<input type="checkbox" name="checkbox" value="checkbox"<?php echo $_SESSION['checkbox']?' checked':''>

Posted: Sun Jun 19, 2005 12:24 am
by Ambush Commander
Hmm, that code snippet doesn't feel right.

Code: Select all

Page 1 -> Page 2 -> Page 3 -- Submit -
  |         |         |              |
 \_/       \_/       \_/            \_/
Session Database -------------- > Email
No need to repopulate the checkboxes. ;-)