I have a listing page which has lots of filters (checkboxes). User selects some of the filters and retrieves results. User can then see the detail of the single result by clicking on any result.
Now what I want is that when the user comes back to the listing page after seeing the detail, it should see the filters intact. The filters could be seen if I comeback through Javascript back function window.history.go(-1);
. But the problem is that the filters are not processed.
To process, the submit button needs to be clicked and that's where my problem lies.
How can I trigger my submit button on the previous page?
Here is what I tried. This is called when Back
button is clicked from the detail page.
$('#back-list').on("click", function(e) {
e.preventDefault();
window.history.go(-1);
//This following line is not working
$('.form-submit').trigger("click");
return false;
});
Thanks.