Wayne Barron
asked on
confirm password on keyup (Before form Submit)
Hello All;
I need to check the password and confirmpassword before the user clicks submit.
I have found all sorts of articles, but all of them are on FormSubmit.
I need to check:
Either while the user is typing into the confirm (This is the preferred method)
(or)
Once the user finishing typing into the confirmpassword.
Thank You
Carrzkiss
I need to check the password and confirmpassword before the user clicks submit.
I have found all sorts of articles, but all of them are on FormSubmit.
I need to check:
Either while the user is typing into the confirm (This is the preferred method)
(or)
Once the user finishing typing into the confirmpassword.
Thank You
Carrzkiss
ASKER
Hey padas, hope you are doing well.
Unfortunately, I cannot use this.
This is used for a new registration, so there is not database entry for the potential member yet.
I am testing
<input type="password" name="password" />
<input type="password" name="confirmpassword" />
Not against a database entry.
Unfortunately, I cannot use this.
This is used for a new registration, so there is not database entry for the potential member yet.
I am testing
<input type="password" name="password" />
<input type="password" name="confirmpassword" />
Not against a database entry.
$("#confirmpasswordID").bind("keyup blur, function() {
if( $("#passwordID").val() == $("#confirmpasswordID").val() ) {
$("#spanOrAnyOtherContainerError").hide();
}
else {
$("#spanOrAnyOtherContainerError").show();
}
})
<input type="password" name="password" id="passwordID" /><span id="spanOrAnyOtherContainerError">bad password</span><br />
<input type="password" name="confirmpassword" id="confirmpasswordID" />
http://jsbin.com/utajow/1/edit
$('#confirm').focusout(function() {
var pass=$('#password').val();
var conf=$('#confirm').val();
if (pass!=conf){
$('#messg').html('Password does not match');
}
});
<input type="password" id="password" name="password" />
<input type="password" id="confirm" name="confirmpassword" />
<div id="messg"></div>
ASKER
Hello Leak.
I am unable to get your code to work.
Also, the
<span id="spanOrAnyOtherContaine rError">ba d password</span>
Is this not supposed to be invisible until it is called?
I am unable to get your code to work.
Also, the
<span id="spanOrAnyOtherContaine
Is this not supposed to be invisible until it is called?
ASKER
@padas.
I tested the link, and if I type in identical entries, it states that it is
Password does not match
I tested the link, and if I type in identical entries, it states that it is
Password does not match
ASKER
@leak
Everyone is welcome to join in on the fun.
I like your code, however, I am trying to make it show ONLY if the passwords are different.
So, I changed the
$("#spanOrAnyOtherContaine rError").s how();
}
else {
$("#spanOrAnyOtherContaine rError").h ide();
and
<span id="spanOrAnyOtherContaine rError" style="display:none;">
This works, but it shows really fast, than it disappears again.
I would like have it only show, if it is different.
Everyone is welcome to join in on the fun.
I like your code, however, I am trying to make it show ONLY if the passwords are different.
So, I changed the
$("#spanOrAnyOtherContaine
}
else {
$("#spanOrAnyOtherContaine
and
<span id="spanOrAnyOtherContaine
This works, but it shows really fast, than it disappears again.
I would like have it only show, if it is different.
work fine for me here : http://jsfiddle.net/LgWKq/3/
ASKER
Once you start typing in the first field, the "bad password" shows.
It needs to only show if it is bad, not when the other field is empty.
It needs to only show if it is bad, not when the other field is empty.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Leak, I gave you the points, as your code got me where I needed to be at.
I also added in my last code as assisted.
Have a good one.
Carrzkiss
I also added in my last code as assisted.
Have a good one.
Carrzkiss
thank you
ASKER
your welcome leak, and thank you.
Have an awesome rest of the week.
Carrzkiss
Have an awesome rest of the week.
Carrzkiss
Open in new window
2) Jquery ajax
Open in new window