|
Forms >>>
Keep your visitors from submitting their form until their "password" and "re-enter password" fields match, for verification purposes. They get an error message telling them to re-enter the passwords if they do not match.
Add the below code to the <body> section of your page:
<script
language="javascript"
type="text/javascript">
function
checkPw(form)
{
pw1
=
form.pw1.value;
pw2
=
form.pw2.value;
if
(pw1
!=
pw2)
{
alert
("\nYou
did not enter the same new password twice. Please re-enter your
password.")
return
false;
}
else
return
true;
}
</script>
<form
onSubmit="return
checkPw(this)">
<table
border=0>
<tr>
<td>Password:</td><td><input
type=text
name=pw1
size=10></td>
</tr>
<tr>
<td>Re-enter:</td><td><input
type=text
name=pw2
size=10></td>
</tr>
<tr>
<td
colspan=2
align=center><input
type=submit
value="Submit!"></td>
</tr>
</table>
</form>
|
|