Hi teseo, sorry just now, complicated day to me.
You try tell me it will working if exists a value in a hidden field selected? And that value can be controled by name or id. That selection can be dynamical by conditional (just thinking).
Let's suppose I have already that occult field pre selected value="1", with name and id named 'ascStartdate'.
Search was submited, '1' as value now, and search results.
On menu (sort by), user clicked on lower price first and occult field have '0' as value now (using javascript).
Unless values are volatile after refresh page by link, I never tried do it before. Is needed keep values in a session?
Well, if is needed, I think function will check to compare the value of occult field (keep him in session), and will run without the last code line to s_startdate 'asc'. Revert again, using a direct link on menu, and add again the value="1" and keep the value again on same session.
Don't know how far it can be possible from my side.
Maybe I not understand yet your strategy, and can avoid my doubts.
Let me know when you can
Thanks for all your effort on help to solve this point.
Regards