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.