Layui determines whether the passwords entered twice are consistent when registering: After submitting the password data in the form, Layui compares the passwords entered twice by calling js code and determines Is it consistent?
1. Confirm password
html:
<div class="layui-form-item"> <div class="layui-inline"> <label class="layui-form-label">登录密码</label> <div class="layui-input-inline"> <input type="password" name="password" lay-verify="required" class="layui-input"> </div> </div> <div class="layui-inline"> <label class="layui-form-label">确认密码</label> <div class="layui-input-inline"> <input type="password" lay-verify="required|confirmPass" class="layui-input"> </div> </div> </div>
js:
// 校验两次密码是否一致 form.verify({ confirmPass:function(value){ if($('input[name=password]').val() !== value) return '两次密码输入不一致!'; } });
Recommended: layuiframeworktutorial
The above is the detailed content of How layui determines password inconsistency. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Chinese version
Chinese version, very easy to use

SublimeText3 Linux new version
SublimeText3 Linux latest version
