PDA

View Full Version : Using "Enter" on Simple Password Script



fartie
04-25-2005, 06:37 AM
I have a simple password = password.htm script on this site.

It works great for when the password is entered and the button is clicked on, but I can't figure out how to make the "enter" key run the "Guardian()" function too.

All I want to do is make it so if someone presses enter instead of actually clicking on the button it will still work.

I would greatly appreciate all help. Thanks. See the page at http://www.instantinfo.net/.

The script is:

<meta http-equiv="Content-Language" content="en-us">
<SCRIPT language="JavaScript">

function Guardian() {
var password = document.form1.password.value;
location.href = 'http://www.instantinfo.net/_private/pages/' + password + '.htm';}

</SCRIPT>

<p align="center">

<align="center">

</p>
<p align="center">&nbsp;</p>
<p align="center">
<img border="0" src="images/InstantInfo_large.gif" width="543" height="196"></p>
<form name="form1">

<div align="center">
<center>

<TABLE BORDER=0 width="553" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0">

<TR>

<TD width="550">
<p align="center"> <input type="password" name="password" size=45>&nbsp;
<input type="button" value=" ENTER " name="enter" onclick="Guardian()" ></TD size="20">

</TR size="20">

</TABLE></center>
</div>