Possible Duplicate:
Checkbox Stays Checked on Page Refresh
![]](https://i.stack.imgur.com/QM0yX.png)
Please see the image carefully. This page is auto refresh every 20 seconds. My issue is see the bottom of the image, i have 8 check box in backup frequency group. when ever i check or un check the check box , i cant able to save the changes due to page refresh. i know i can increase the time of refresh and its possible. But i need some other logic to prevent the checked or un checked value untill i click “Applay changes” (save).
For example the 8 checkbox have 8 different id, When ever i click the id , i set the value true when its checked, other wise false. etc . please write a code in jquery or javascript.
Please come up with a working code for this doubt. Thanks in advance.
Simple and correct solution is NOT to refresh page every 20 secs, not refresh it at all. Depending on the reason for refresh you could replace it with a ajax call.
Alternatively if you want to do it wrong way, refresh page from javascript by setting document.location say every N secs, but before changing location check if user has changed values, in that case don’t change location until user has pressed save button and hence reloaded page e.g. something like this