Re: I need some help coding a Form
Hi Charles
Just in case you do not have PHP, try the script below.
The password is set to 'letmein'.
When correct, the user is sent to the success.htm page, when wrong they are asked to enter the correct information and the original page (answer.htm) is reloaded.
Hope this helps!
Kind regards
webboc
<form>
<p>Enter correct answer:
<input type="password" name="text1">
<input type="button" value="Go" name="Submit" onclick=javascript:validate(text1.value,"letmein") >
</p>
</form>
<script language = "javascript">
function validate(text1,text2)
{
if (text1==text2)
load('success.htm');
else
{
alert("Please enter the correct information");
load('answer.htm');
}
}
function load(url)
{
location.href=url;
}
</script>
Last edited by webboc : 05-31-2006 at 06:51 PM.
|