Error with the form?
I've just created a form below. It doesn't look too much complicated. The users have to type in password. If it correct, index.html will be loaded. If I click on the button, it works great. But if I just type the word and press enter, it won't work. How can I change? Thanks for any help.
------------password.html------------
<html>
<head>
<script language="JavaScript">
function loadpage()
{
if (document.form.pswd.value=="testing")
document.location.href="index.html"
else
document.location.href="password.html"
}
</script>
</head>
<body>
<form name=form> Enter password
<input type=text name=pswd>
<input type=button value="Proceed" onClick="loadpage()">
</form>
</body>
</html>
--------------------------------------
Lloyd Hassell posted this at 03:55 — 14th May 2000.
They have: 231 posts
Joined: Feb 2000
Add this to your <form> tag:
action="javascript:loadpage()"
If that doesnt work, there is something else you can try.
ChanhVu posted this at 05:06 — 14th May 2000.
They have: 3 posts
Joined: May 2000
Thank you so much. It works, great!!!
I've been struggling for hours with this.
Thanks. Love your forum!!!!
Chanh Vu
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.