View Full Version : Confirm password
Hybrid
10-08-2005, 08:56 PM
hi how do you create to fields in a form so that the check to make sure thier the same couz i'm tryin to make a register form and i need and password and confirm password field.
mwinter
10-09-2005, 01:21 AM
hi how do you create to fields in a form so that the check to make sure thier the same
function validate(form) {
var elem = form.elements;
if(elem.password.value != elem.confirm.value) {
alert('Please check your password; the confirmation entry does not match.);
return false;
}
return true;
}
<form action="..." method="post" onsubmit="return validate(this);">
<!-- ... --->
<label>Password: <input name="password" type="password" value=""></label>
<label>Confirm password: <input name="confirm" type="password" value=""></label>
<!-- ... -->
</form>
couz i'm tryin to make a register form and i need and password and confirm password field.Just make sure you check the values server-side!
Mike
Hybrid
10-09-2005, 12:35 PM
thanx
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.