Hi, I am very new to
js and am using a simple login script I found at
www.laughland.biz. I needed this script to do 2 things it did't:
setfocus on the username field
allow the usesr to hit return after entering their pw and be logged in.
I got the first one, but can't for the life of me get the second.
Here's the code block I'm assuming this function would be in:
function BuildPanel() {
document.write('<form name="logon"><table align="center" border="0"><tr><td align="center">');
document.write('
Username:</td>');
document.write('<td>
<input type="text" name="username" size="20"></td></tr>');
document.write('<tr><td align="right">
Password:</td>');
document.write('<td>
<input type="password" name="password" size="20"></td></tr>');
if(imgSubmit == ""){
document.write('<tr><td align="center" colspan="2"><p><input type="button" name="Logon" value="Logon" onClick="login(username.value,password.value)" onKeyPress="login(username.value,password.value)"> ');
} else {
document.write('<tr><td align="center" colspan="2"><p><input type="image" src="'+imgSubmit+'" name="Logon" onclick="login(username.value,password.value)">');
}
if(imgReset == ""){
document.write('<input type="reset" value="Reset" name="Reset">');
} else {
document.write('<input type="image" src="'+imgReset+'" name="Reset" onclick="logon.reset();">');
}
document.write('</p></td></tr></table></form>');
}
function setfocus() {
document.logon.username.focus();
}
K. Dawn Merrill