0

I was wondering if there was a way to make a "remember me" button for a login form. I am working on a javascript only login box, that is pretty secure, but I just need to know how to make that remember me checkbox! Please help!

Here is the current client side code:

<html>

<head>
    <title>Login</title>
<script type="text/javascript">
<!--
function authPass(u,p) {
    if (u && p) self.location = "auth.htm?" + u + p;
    return false;
}
// -->
</script>
<link href="style-home.css" type="text/css" rel="stylesheet" />
</head>
<body>
    <div>
<script type="text/javascript">
<!--
if (location.search.indexOf("auth=failed") != -1) {
    document.write("<span style=\"color:#ff0000\">Login Failed!  You have entered the incorrect authorization information, please try again.</span>");
}
// -->
</script>
        <form id="form1" action="javascript://" onsubmit="return authPass(this.user.value,this.pass.value)">
            <table>
                <tr>
                    <td>Username: </td><td><input type="text" name="user" /></td>
                </tr>
                <tr>
                    <td>Password: </td><td><input type="password" name="pass" /></td>
                </tr>
                <tr>
                    <td colspan="2" align="center"><input type="submit" value="Login" /></td>
                </tr>
            </table>
        </form>
    </div>
</body>
</html>
2
Contributors
1
Reply
16
Views
4 Years
Discussion Span
Last Post by pritaeas
1

It's just a checkbox. You should have code on submit to store enough information to login in a cookie. When you access your page, you can check if it exists with valid info, and if so, submit automatically.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.