简体   繁体   English

验证新密码并确认密码

[英]Validation for new password and confirm password

I need validation for new password and confirm password with below criteria. 我需要验证新密码并使用以下标准确认密码。

Use 8 to 16 character Password should contain at least 1 numeric and 1 alphabet Special Character Password is case sensitives 使用8到16个字符密码应包含至少1个数字和1个字母特殊字符密码区分大小写

 <div class="panel-body"> <div class="Container"> <span class="Heading"> Create a New Password </span> <form method="post" name="sentEmailForm" id="resetPasswordForm" action = "/reset-password?q=<?php echo $qhffj; ?>"> <div class="col-sm-12 p-0 mbottom20"> <div class="col-sm-2 p-0 left"> <label>Enter New Password</label> </div> <div class="col-sm-10 p-0 right"> <input type="password" name="password" id = "password" class="" /><br/> </div> </div> <div class="col-sm-12 p-0 mbottom20"> <div class="col-sm-2 p-0 left"> <label>Confirm Password</label> </div> <div class="col-sm-10 p-0 right"> <input type="password" name="confirmpassword" id ="confirmpassword" class="" /><br/> </div> </div> <div class="col-sm-12 p-0"> <div class="col-sm-2 p-0 left"> </div> <div class="col-sm-10 p-0 greycolor right"> <span class="bullet"> Use 8 to 16 character </span><br> <span class="bullet"> Password should contain at least 1 numeric and 1 alphabet </span><br> <span class="bullet"> Special Character </span><br> <span class="bullet"> Password is case sensitives </span><br> <input type="submit" value="Create Password" class="btn btn-primary" ></input> </div> </div> <div class="clearfix"></div> </form> </div> </div> 

You can use the pattern attribute on your input type = "password" to validate the data that is inserted in your form. 您可以使用input type = "password"上的pattern属性来验证表单中插入的数据。 The pattern accepts regex, which you can test here . 该模式接受正则表达式,您可以在此处测试

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM