THE FORM
Code:
<form name="signup" method="post" onSubmit="verifyIt(this)" onReset="javascript:confirm(Reset The Form?)">
<fieldset>
<legend>Sign Up</legend>
<p>
<label for="username">Preferred Username:</label>
<input type="text" name="username" id="username" value="" />
</p>
<p>
<label for="password">Preffered Password:</label>
<input type="password" name="password" id="password" value="" />
</p>
<p>
<label for="Vpass">Verify Password:</label>
<input type="password" name="Vpass" id="Vpass" value="" />
</p>
<p>
<label for="Email">Email Address:</label>
<input type="text" name="Email" id="Email" value="" />
</p>
<input type="submit" value="Submit" />
<input type="reset" value="Clear Form" />
</fieldset>
</form>
MAKING IT LOOK GOOD
Code:
<style type="text/css">
<!--
p label {
float: left;
clear: left;
}
p input {
float: right;
clear: right;
}
// -->
</style>
Function to see if they are the the same, alert user if they aren't and return to the "password" field
Code:
<script type="text/javascript">
// <![CDATA[
function verifyIt() {
form = document.signup;
if(form.password.value !== form.Vpass.value) {
alert("Passwords do not match, please check them")
form.password.focus();
}
}
// ]]>
</script>
Bookmarks