I have a login form for which I would like to store the username (input field: username) in a cookie via Jquery the moment I click a checkbox ('remmber me'). Does anyone know how to do this?
Tell me more
×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
This guide shows how to use the Cookie plugin for jQuery: http://www.electrictoolbox.com/jquery-cookies/ Then you can use something like this in your javascript files:
| |||||||||
|
Building upon Henridv's answer, I ended up doing this:
Note that my solution also sets the cookie to false, if the checkbox is deselected. In other words, this keeps the cookie current. | |||
|