Welcome Guest, Not a member yet? Register   Sign In
DropDown with onchange event
#6

(This post was last modified: 03-29-2017, 05:58 AM by Martin7483.)

Your onchange triggers an AJAX event, and that will change the data based on the selection made.

But your AJAX event does not modify the URL in your browsers addressbar. So when you refresh the whole page it will load the default and not the last made selection.

Update your AJAX event and add some code to the success function that will also modify the URL. How to do that can be found here:
modify-the-url-without-reloading-the-page

OR

you could set a $_SESSION variable and store the last made selection in it. When you then load for the first time or reload the whole page you check to see if it has been set. If it has been set use the value for your query.
Reply


Messages In This Thread
DropDown with onchange event - by nxs_02 - 03-26-2017, 08:47 PM
RE: DropDown with onchange event - by qury - 03-27-2017, 04:47 AM
RE: DropDown with onchange event - by nxs_02 - 03-28-2017, 05:42 PM
RE: DropDown with onchange event - by nxs_02 - 03-28-2017, 06:00 PM
RE: DropDown with onchange event - by nxs_02 - 03-28-2017, 07:12 PM
RE: DropDown with onchange event - by Martin7483 - 03-29-2017, 05:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB