Can one click be made to results in two or more actions?

Hi All,

I seem to have lost my way and I would like some advice if possible on the approach to take to a pagination issue.

The pagination itself works fine. But I have set this up using a series of href’s with a page parameter passed into the url to tell which page is current.

I would like to be able to make various selections by ticking a checkbox and have these selections stored so that as I pass backwards and forwards through the pages these selections persist(or can be reconstructed). With all the accumulated selections being processed when ever the process button is clicked.

I hope I have described that clearly enough. It would appear to me to be a perfectly reasonable goal.

My initial thought was to effectively submit a form each time paginationation took place, and part process the captured data.

To this end I have attempted to use jQuery or straight javascript to submit the the form onclick and allow the href default action to effect the pagination.

I have tried with code such as

<a href=“#” onclick=“document.forms[0].submit();return false;”>
or
<a href=“#” onclick=“document.forms[‘select_Client’].submit();return false;”>

and various variants on this.

No matter how I try to phrase this the href appears to takeover and just return me where I started.

I have also tried to use ajax in a jquery function to run the files that would normally be actioned by the form.

For example:
$(“#next”).click(function(event){
$.ajax({url: “…/process_Client_Select.php”});
});

this has the same effect.

I can do a series of redirects to preserve the selections but this doesn’t help when it come to process the selections as a whole.

I am thinking that a session variable might be the way to go. But this still means that at some point I need to detect how the checkboxes are set at a given point i.e upon the click.

I want the click to result in two actions process the form and paginate.

Well you are guys probably bored of reading these rambling thoughts. Anyone got any ideas.

Regards

I would separate your pagination from another functionality. I you using ajax for pagination, why not request page for dynamic content only and do not reload entire page? Read data from requested by ajax page or web service and populate in your dynamic area in this case all your filters will stay the same. you can add a counle hidden fields to store curren page number and etc.

Thanks gk53, Yes I think you are right I need to take a few steps back and look again at what could be achieved with AJAX. The pagination class is separate. As you say it should stay that way.