0
I have on the page that lists the properties of my site a search form and a select that makes the result ordering.
The problem: Doing a search in the form and passing the values via get Ctr=0&min=20000&max=999999&suites=3 etc. and right after choosing an sorting option the url I lost these values because the page is updated and makes an ordering of the general result. When you select a sort option, I want to sort the result that appears on the page and so I need the previous filter parameter to remain in the url and add the sort parameter.
I am sending the action to sort this way and so I miss the values that are in the url:
$("select.ordenacao").change(function() {
$("select.ordenacao").each(function() {
str = $( this ).val();
//alert(str);
//$("#ordenar").submit();
location.href = '?ordenacao=' + str;
});
});
anyone has any suggestions?
Why don’t you do that in ajax, or restful? So you wouldn’t need to refresh the page.
– Ivan Ferrer
If you show me an example of how to do this with Ajax I am grateful, still can not understand very well how to make requests with Ajax in php files and show the result in a return.
– Igor Silva
ajax works asynchronously, through an anonymous function using callback, you have a return executed, within an element that will receive this action, without having to give a refresh again, it does so in a masked way, in a php script.
– Ivan Ferrer