//Remember username Password function save() { if ($("#ck_rmbUser").prop("checked")) { var username = $("#username").val(); var password = $("#password").val(); $.cookie("rmbUser", "true", { expires: 7 }); //Storage a cookie with a 7-day expiry date $.cookie("username", username, { expires: 7 }); $.cookie("password", password, { expires: 7 }); }else{ $.cookie ("rmbUser", "false", { expire: -1 }); $.cookie("username", "", { expires: -1 }); $.cookie("password", "", { expires: -1 }); } };
function check(){ var username = $("#username").val(); var password = $("#password").val(); if(username == "" || username == "Please enter the username"){ $("#tip") .text("Please enter your username!"); $("#username").focus(); return false; } if(password == "" || password == "Please enter your password"){ $("#tip").text("Please enter your password!"); $("#password").focus(); return false ; } $("#tip").text(""); return true; }
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn