How to paginate the AJAX generated results?

Hi,

So I have multiple group of checkboxes and I pass an object to the php page with the values of checked boxes to get the results from MySQL and display on the same page:

$(":checkbox").on('change', function() {
    var mygroup = {};
    $(':checkbox:checked').each(function(i) {
        var val = this.value;
        var name = this.name;
	
	mygroup[name] = (mygroup[name] || []).concat([val]);
});
$.ajax({ 
    type: "POST", 
    url: 'process.php',
    data: mygroup,
    success: function(data) {
        $("#resultdiv").html(data);
    }
});
});

I can get the values of the $_POST[‘thename’] in php. I get the results all ok. But how and where do i paginate the results? Also, what if i want to add a select box or a radio button, how do i pass the value in the same mygroup object? I tried to put the object out of the checkbox change event, but it does not update on change.

thanks.

This page may be helpful. Characters from an input box are passed to the Ajax routine, formats a MySQL statement then renders the results.

Hi, Thanks but its not applicable to my issue. I want the results to be displayed onclick of the checkbox and paginate the results.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.