Twitter bootstrap compare password validation
23,072
You can't validate a form
using css
, if you don't want jquery validate plugin
then you can try it like,
$('form').on('submit',function(){
if($('#pass').val()!=$('#cpass').val()){
alert('Password not matches');
return false;
}
return true;
});
HTML
<form class="form-signin">
<input type="email" class="input-block-level" placeholder="Email address" required="">
<input id="pass" type="password" class="input-block-level" placeholder="Password" required="">
<input id="cpass" type="password" class="input-block-level" placeholder="ConfirmPassword" required="">
<button class="btn btn-large btn-primary" type="submit">Sign in</button>
</form>
Related videos on Youtube
Author by
NewtonCode
Updated on November 07, 2020Comments
-
NewtonCode over 3 years
I have done a basic form using twitter bootstrap . I was able to perform some validation also.
<form class="form-signin"> <input type="email" class="input-block-level" placeholder="Email address" required=""> <input type="password" class="input-block-level" placeholder="Password" required=""> <input type="password" class="input-block-level" placeholder="ConfirmPassword" required=""> <button class="btn btn-large btn-primary" type="submit">Sign in</button> </form>
In numerous examples i searched , nobody has used compare password validation. I was wondering if there is a compare password validation in twitter bootstrap other than using j query validator ? Can compare password validation be performed by using css and not by using form.validate() script?
Thanks
-
Ohgodwhy over 10 yearsplease note that you just need
required
notrequired=""
-
NewtonCode over 10 years@Ohgodwhy thnx dude .
-
NewtonCode over 10 years@Ohgodwhy can u help me on compare password validation?
-
-
SeinopSys over 10 years
$('#confirmPsd')
is missing a#