Jump to content

Createing a cookie for Checkbox

Agent Moose

Recommended Posts

Without writing the code, these are the steps I would take:

  1. When the form is submitted, check to see whether or not the checkbox is checked.
  2. Write that value to the cookie.
  3. The next time the page is loaded, check for the existence of the cookie.
  4. If the cookie is present and the value indicates that the checkbox had been checked, then the checkbox was checked. Otherwise, the checkbox wasn't checked.
  5. Access the checkbox through the DOM and set its checked property to true or false depending on the findings of the previous step.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...