直播app开发搭建,注册时确定两次密码一致

直播app开发搭建,注册时确定两次密码一致

1、verification.jsp

onblur 事件会在对象失去焦点时发生

 


<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<script type="text/javascript" src="../js/jquery02.js"></script>
<body>
<script>
    function verification() {
        var pw1 = document.getElementById("repassword").value;
        var pw2 = document.getElementById("password").value;
        if(pw1 == pw2) {
            document.getElementById("tishi").innerHTML="两次密码相同";
            document.getElementById("button").disabled = false;
        }
        else {
            document.getElementById("tishi").innerHTML="两次密码不相同";
            document.getElementById("button").disabled = true;
        }
    }
</script>
    <p id="tishi" style="color: red"></p>
    <p>账号:<input type="text" name="name"><br></p>
    <p>密码:<input type="text" id="password" onblur="verification()"><br></p>
    <p>确认:<input type="text" id="repassword" onblur="verification()"></p>
        <input id="button" type="submit"  value="提交">
</body>
</html>

以上就是直播app开发搭建,注册时确定两次密码一致, 更多内容欢迎关注之后的文章 

 

posted @ 2022-12-16 14:08  云豹科技-苏凌霄  阅读(37)  评论(0)    收藏  举报