[Solved] Saving the status of checkboxes using cookies?

Hi all!

I’d like to save the statues of checkboxes on a site to the users computer. Here is what I have:

<input type="checkbox" name="c1"> Brakes - On<br>
<input type="checkbox" name="c1"> Throttle - Idle<br>

Say if the user ticks <input type="checkbox" name="c1"> Brakes - On<br>, is there a way to save that to their computer and then when they reload the page to keep it?


You can look into it more here

Essentaily, you can create a JSON object and save it to localStorage, then on page-load load the JSON string saved in localStroage and parse it into usable JSON.

Yep, I want to use local storage on the users device. :smile:

For an example, you can see how I used it in http://codepen.io/AbdiViklas/pen/PbZqPK (including a check for whether it’s present and error handling if not)

1 Like

Thank you very much!

Managed to get a simple solution!