I have multiple checkboxes group whose value, if checked, is passed to a php page in an object with jquery, i get the results all good. Now I want to paginate the results. I am not sure how to go about this. As using pagination is not returning any value passed by AJAXPOST. My JS :
$(":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]);
});
var itemsPerPage = 5;
if(typeof url == 'undefined' ){
url = "finalprocess1.php?page=1&items_per_page="+itemsPerPage;
}
$.ajax({
type: "POST",
url: 'finalprocess.php',
data: mygroup,
success: function(data) {
$.getJSON(url, function(data){ //NOT SURE IF I CAN DO THIS
var result = userTemplate({users : data.users}) //UNDERSCORE TEMPLATING
$("#theresult").html(result);
});
}
});
});