Show/Hide via Checkbox with Persistent Cookies

Basically, you have a “control panel” consisting of a number of categories, each with a checkbox. If you check the box, it displays things in that category. If you uncheck the box, those go away. A relatively simple concept. Drop in cookies so the site remembers your last show/hide settings to avoid annoying your visitors, e.g. “Every time I view the page, I see everything… even the stuff I turned off last time.”

I can imagine a number of use cases for things like this, and have implemented it twice. Once using YUI, and more recently using jQuery.

View the source of the pages linked above.

Advertisements

One thought on “Show/Hide via Checkbox with Persistent Cookies

  1. Hi Gary(?) —

    May I send you an email to enquire about the code for your “Show/Hide via Checkbox with Persistent Cookies” example, please? It is the only example of checkbox functionality that I have been able to find that behaves the way I want my checkboxes to behave.

    Thank you, sincerely.

    — Nelson

    PS – I was born in Illinois, too. In 1945. That makes me old(er ;-)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s