I need to validate if the age for a alcohol website. And what I need is all here. I\'m nearly there but I\'m not sure is correct . Locally doesn\'t work. I need the
$('.submit').click(function() {
should be
$('#submit').click(function() {
$(".submit") refers to a CLASS and $("#submit") refers to an ID.
and you'll have to add some logic for checking if the remember checkbox is checked, i think you attempted to, but weren't able to see if it was successful because the code never executed. I added the logic for you (simple if statement) and within that, you need to add the cookie creation code.
if ($('#remember').is(":checked")) {
$.cookie('age', age, { expires: 365 });
} else {
$.cookie('age', age);
}
(uses https://github.com/carhartl/jquery-cookie)
http://jsfiddle.net/bhdry/45/