PHP, JavaScript or sessions? URGENT

A

Anonymous

Guest
I have a results page which pulls 'contacts' from a database...There are so many records so it must be seperated by pagination. Checkboxes are setting up name=checkbox[] and value=(email from the database).... I have a form setup around the results inorder for a user to select the contacts he wants and then click submit which transfers the checkbox data onto the next page where they can email the selected contacts. That works fine.

The thing is, the pagination works through an URL parameter, and if I use pagination I lose my checkbox data on the subsequent pages, how do I keep their ticked status?

I dont know how to have the checkboxes maintain their status across the pagination. Can ANYBODY give me a hint in the right direction of what to do? should I be using JavaScript for what I want to do?

Thanks
 
quite a common problem...

if you can... every paging... link has

Code:
<script type='text/javascript'>
function form_submit(pagindata) {
   document.form['formname'].action = 'originalpath'+pagindata;
   document.form['formname'].submit();
}
</script>
...
<a href="javascript: form_submit(somepageingdata)" />1</a>

now the following page you get all the checkboxes selected in $_POST and paging in $_GET
 
I'm not familiar with JavaScript, could you explain your script step by step please? It makes a form submit function and then by using that url I submit the form? But what form is being submitted? I have the <form> around the checkboxes but then the submit button submits the checkbox data to the email form...how could I submit that same form but instead going to the paging url + keeping the checkbox data? Is that not what I'd need to do?

Thanks again for the reply
 
.how could I submit that same form but instead going to the paging url + keeping the checkbox data? Is that not what I'd need to do?
yes that is exactly what is to be done
you submit the form of the checkboxes....
and you modify the code of paging... that produces hrefs to a way that the onclick event of the href submits the form in POST, and as well sends get requests to the other page, (the get variables could be used for paging)
 
Back
Top