G
Greg Guarino
I don't know anything about javascript. I'm using a password login
script that I found online. It works fine if you use the "Enter"
button on the page, but people are in the habit of using their
keyboard ENTER key. When they do so, it erases the password from the
box, like the "RESET" button does.
Is there a way to make the ENTER key operate the Enter function, like
the button on the page? Here's the relevant code:
-----------------------------------------
<SCRIPT LANGUAGE="JavaScript">
//---------------------------------
//LOGIN SCRIPT BY ALEX KEENE 1997
//[email protected]
//---------------------------------
function Getstats() {
window.status=('Attempting to Login to user area.')
var AccId;
var iName;
AccId = document.iAccInput.iAccID.value
iName = document.iAccInput.iName.value
if (AccId == "" || iName == "")
{
alert('\nERROR\nYou must enter ALL Details \nto log in \n');
window.status=('Missing data or Invalid. Check spelling and
Ensure Names are in Correct Case.')
}
else
{
var location=( iName + AccId + ".pdf");
this.location.href = location;
window.status=(' Verifying: ' + iName + '-' + AccId + ' Please
wait........');
}
}
</SCRIPT>
</HEAD>
<BODY alink="#ff0000" background="stripe.jpg" bgcolor="#ffffff"
link="#0000ff" text="#000000" vlink="#cc00cc"
onLoad="window.status=('You will need a password and username to
proceed further...');">
<p></p>
<FORM NAME="iAccInput">
<CENTER>
<TABLE
BORDER="3" CELLPADDING="2" CELLSPACING="8" BGCOLOR="#CCCCCC"
BORDERCOLOR="#808080" BORDERCOLORLIGHT="#808080"
BORDERCOLORDARK="#000000">
<TR>
<TD ALIGN="RIGHT">
<FONTSIZE="3" COLOR="#FF0000"
FACE="Arial"><B>Password:</B></FONT></TD>
<TD><INPUT TYPE="HIDDEN" NAME="iName" MAXLENGTH="15" value="acou">
<INPUT NAME="iAccID" MAXLENGTH="15" HEIGHT="50"></TD>
<TD><INPUT TYPE="BUTTON" VALUE=" Enter " onClick="Getstats()"
HEIGHT="40" WIDTH="50"><BR>
<INPUT TYPE="RESET" VALUE=" Reset " onClick="window.status=('RESET:
Please enter your USERNAME and ACCOUNT ID.')" WIDTH="50">
</TD></TR></TABLE></CENTER>
script that I found online. It works fine if you use the "Enter"
button on the page, but people are in the habit of using their
keyboard ENTER key. When they do so, it erases the password from the
box, like the "RESET" button does.
Is there a way to make the ENTER key operate the Enter function, like
the button on the page? Here's the relevant code:
-----------------------------------------
<SCRIPT LANGUAGE="JavaScript">
//---------------------------------
//LOGIN SCRIPT BY ALEX KEENE 1997
//[email protected]
//---------------------------------
function Getstats() {
window.status=('Attempting to Login to user area.')
var AccId;
var iName;
AccId = document.iAccInput.iAccID.value
iName = document.iAccInput.iName.value
if (AccId == "" || iName == "")
{
alert('\nERROR\nYou must enter ALL Details \nto log in \n');
window.status=('Missing data or Invalid. Check spelling and
Ensure Names are in Correct Case.')
}
else
{
var location=( iName + AccId + ".pdf");
this.location.href = location;
window.status=(' Verifying: ' + iName + '-' + AccId + ' Please
wait........');
}
}
</SCRIPT>
</HEAD>
<BODY alink="#ff0000" background="stripe.jpg" bgcolor="#ffffff"
link="#0000ff" text="#000000" vlink="#cc00cc"
onLoad="window.status=('You will need a password and username to
proceed further...');">
<p></p>
<FORM NAME="iAccInput">
<CENTER>
<TABLE
BORDER="3" CELLPADDING="2" CELLSPACING="8" BGCOLOR="#CCCCCC"
BORDERCOLOR="#808080" BORDERCOLORLIGHT="#808080"
BORDERCOLORDARK="#000000">
<TR>
<TD ALIGN="RIGHT">
<FONTSIZE="3" COLOR="#FF0000"
FACE="Arial"><B>Password:</B></FONT></TD>
<TD><INPUT TYPE="HIDDEN" NAME="iName" MAXLENGTH="15" value="acou">
<INPUT NAME="iAccID" MAXLENGTH="15" HEIGHT="50"></TD>
<TD><INPUT TYPE="BUTTON" VALUE=" Enter " onClick="Getstats()"
HEIGHT="40" WIDTH="50"><BR>
<INPUT TYPE="RESET" VALUE=" Reset " onClick="window.status=('RESET:
Please enter your USERNAME and ACCOUNT ID.')" WIDTH="50">
</TD></TR></TABLE></CENTER>