I have a form where user enters a password text, then has to click the Submit Password button. How do I add the option to press Enter key to call the same function 'goForit'?
I read similar posts/replies, but I don't know enough to make it work for me. I got this form and script from a free sript site. Trying to learn...thahks in advance for any help.
here is the code:
[html]
<html>
<head>
<SCRIPT LANGUAGE="JavaS cript">
<!-- Begin
function goForit() {
var location;
var password;
password=this.d ocument.testfor m.inputbox.valu e
location=passwo rd + ".asp"
fetch(location)
theKeeper=windo w.close()
}
function fetch(location) {
var root;
if (opener.closed) {
root=window.ope n('','theKeeper sGopher','toolb ar=yes,location =yes,status=yes ,menubar=yes,sc rollbars=yes,re sizable=yes,cop yhistory=no');
root.location.h ref = location;
} else {
opener.location .href = location;
}
}
// End -->
</SCRIPT>
</head>
<body onLoad="top.win dow.focus()" BACKGROUND="ima ges/gatekeeper_mana gers1.jpg">
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR>
<TD ROWSPAN=2 WIDTH=200px><im g src="../images/clear_1px.gif" width="200px" height="1">
<TD WIDTH=50% ALIGN=CENTER VALIGN=MIDDLE class="maintext " style="color: #ffffff;">
<p> </p>
<p>Please enter your Password. If you do not have one, contact your Manager for
Assistance.
<BR>
</p>
<TR>
<TD WIDTH=50% ALIGN=CENTER VALIGN=BOTTOM>
<p> </p>
<CENTER>
<FORM NAME="testform" >
<INPUT TYPE="text" NAME="inputbox" VALUE="" size=20>
<INPUT TYPE="button" NAME="button" Value="Submit Password" onClick="goFori t(this.form)">
</FORM>
</CENTER>
</TABLE>
</body>
</html>
[/html]
<!-- Script Size: 1.71 KB -->
I read similar posts/replies, but I don't know enough to make it work for me. I got this form and script from a free sript site. Trying to learn...thahks in advance for any help.
here is the code:
[html]
<html>
<head>
<SCRIPT LANGUAGE="JavaS cript">
<!-- Begin
function goForit() {
var location;
var password;
password=this.d ocument.testfor m.inputbox.valu e
location=passwo rd + ".asp"
fetch(location)
theKeeper=windo w.close()
}
function fetch(location) {
var root;
if (opener.closed) {
root=window.ope n('','theKeeper sGopher','toolb ar=yes,location =yes,status=yes ,menubar=yes,sc rollbars=yes,re sizable=yes,cop yhistory=no');
root.location.h ref = location;
} else {
opener.location .href = location;
}
}
// End -->
</SCRIPT>
</head>
<body onLoad="top.win dow.focus()" BACKGROUND="ima ges/gatekeeper_mana gers1.jpg">
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR>
<TD ROWSPAN=2 WIDTH=200px><im g src="../images/clear_1px.gif" width="200px" height="1">
<TD WIDTH=50% ALIGN=CENTER VALIGN=MIDDLE class="maintext " style="color: #ffffff;">
<p> </p>
<p>Please enter your Password. If you do not have one, contact your Manager for
Assistance.
<BR>
</p>
<TR>
<TD WIDTH=50% ALIGN=CENTER VALIGN=BOTTOM>
<p> </p>
<CENTER>
<FORM NAME="testform" >
<INPUT TYPE="text" NAME="inputbox" VALUE="" size=20>
<INPUT TYPE="button" NAME="button" Value="Submit Password" onClick="goFori t(this.form)">
</FORM>
</CENTER>
</TABLE>
</body>
</html>
[/html]
<!-- Script Size: 1.71 KB -->
Comment