简体   繁体   中英

Checkbox gets unchecked after refresh in google chrome

My website has a search box. If you search a term, it will give results. The results page have a checkbox to filter the results.

When I click on the checkbox, the result page gets refreshed to give the filtered results. I get the filtered results but the checkbox gets unchecked in google chrome.

The same checkbox remains checked if I use firefox or IE(all versions).

I want the checkbox to remain checked so that user knows that the checkbox was checked to filter out result.

It would be preferable if javascript can be used to solve this issue.

Thanks!!!

You should use Session, as CodeSlayer said. Take a look at this link: Create a simple PHP login with sessions and multiple users Create a session variable that is 1 if the checkbox is checked, 0 otherwise and verify at the beginning of the page what is the state of the checkbox and check it accordingly. For needing more information about how to do this ask.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM