Twinkie
Banned
- Messages
- 1,389
- Reaction score
- 12
- Points
- 0
It's that time of the day again when your brain shuts down
Anyone know why this doesn't work? I really don't see why...
I get an error saying that document.login.submit() is not a function? Any help would be appreciated!
Anyone know why this doesn't work? I really don't see why...
HTML:
<script type="text/javascript" src="scripts/sha1.js"></script>
<script type="text/javascript">
function $(id) {
return document.getElementById(id);
}
function Submit() {
if (!document.login.user.value) {document.login.user.style.backgroundColor="#FF7575"; return false;}
if (!$("pass").value) {$("pass").style.backgroundColor="#FF7575"; return false;}
document.login.pass.value = hex_sha1($("pass").value);
document.login.submit();
return true;
}
</script>
</head>
<body><br />
<h1 align="center">SQL Administration</h1><form action="#" method="post" name="login">
<input type="hidden" name="do" value="login" />
<input type="hidden" name="pass" value="" />
<table border="0" align="center">
<tr><td>Username:</td>
<td><input type="text" name="user" onfocus="this.style.backgroundColor='#FFFFCC';" onblur="this.style.backgroundColor='#FFFFFF';" /></form></td></tr>
<tr><td>Password:</td>
<td><input type="password" id="pass" onfocus="this.style.backgroundColor='#FFFFCC';" onblur="this.style.backgroundColor='#FFFFFF';" /></td></tr>
</table><br />
<center><input type="button" value=" Login " id="submit" /></center>
<script type="text/javascript">
$("submit").onclick = Submit;
document.login.onsubmit = Submit;
</script>
Last edited: