• java密码效验,用户名唯一效验


    实现鼠标移开输入框,即刻提示输入内容是否可用

    用户名唯一效验

    输入框

    <p id="p"></p>
    <input type="text" name="userName" id="userName">

    js

    <script>
    userName.onblur = function () {

    $.post(
    "/admin/isname" ,
    { username: userName.value,aeg:18},
    function (data) {
    if (data.code=="400"){
    $("#p1").html("用户名已被注册,请重新输入!").css("color","red");
    }else {
    $("#p1").html("用户名可用!").css("color","green");
    }
    });
    };

    </script>

    两次输入密码一致性效验

    输入框

    <b id="warning" style="color: red"></b>
    <input type="password" name="user.password" id="password">
    <input type="password" name="repeatPassword" id="repeatPassword" onblur="check()">

    js

    <script>

    function check(){
    if(
    document.getElementById("password").value!= document.getElementById("repeatPassword").value
    ) {
    document.getElementById("warning").innerHTML=" 两次密码的输入不一致";
    }else{
    document.getElementById("warning").innerHTML=" ";
    }
    };
    </script>

    用户名唯一性校验和密码一致性校验的实现方式可通用。

  • 相关阅读:
    标准差,绝对中位差
    批处理计时
    四元数压缩
    float类型的存储方式
    通俗易懂理解——浮点与定点的计算机表示及互转
    max MultiRes修改器
    Topogun拓补工具
    3dmax高模到低模烘法线
    在线曲线绘制
    景深
  • 原文地址:https://www.cnblogs.com/nnnnmmmm/p/11316280.html
Copyright © 2020-2023  润新知