pagerfanta submit with the form data

357 Views Asked by At

I have a form with criterias that return a list of results in the same view adding the PagerFanta paginator. To go to next page or previous page I need send the same form data (criterias).

What is the better way?

Thank you and I'm sorry for my English.

1

There are 1 best solutions below

0
On

I have solved with this approach:

When I render the view of twig I Always fill the form with the data of previous post...

With this javascript code I get the expected result

$('.pagination ul > li > a').click(function(event) {
  event.preventDefault();
  $('#form_name').attr('action', this.href);
  $('#form_name').submit();
});