• 用户注册检测(js)


        function isEmail(obj) {
            reg = /^\w{3,}@\w+(\.\w+)+$/;
            $("#emailSure").removeClass('imgSure');
            if (!reg.test(obj)) {
                $("#emailSure").attr("src", "img/error.png");
            }
            else {
                $("#emailSure").attr("src", "img/success.png");
            }
        }
        function isUserName(obj) {
            reg = /^[a-z,A-Z]+$/;
            $("#userSure").removeClass('imgSure');
            if (!reg.test(obj)) {
                $("#userSure").attr("src", "img/error.png");
            }
            else {
                $("#userSure").attr("src", "img/success.png");
            }
        }
        function isPassword(obj) {
            reg =/^[a-z,A-Z]w{5,17}$/;
            $("#passSure").removeClass('imgSure');
            if (!reg.test(obj)) {
                $("#passSure").attr("src", "img/error.png");
            }
            else {
                $("#passSure").attr("src", "img/success.png");
            }
        }
        function affirm(obj) {
            reg=/^[a-z,A-Z]w{5,17}$/;
            reg1 = $("#password1")[0].value;
            reg2 = $("#password2")[0].value;
            $("#passSure1").removeClass('imgSure');
            if (reg1 != reg2||!reg.test(obj)) {
                $("#passSure1").attr("src", "img/error.png");
            }
            else {
                $("#passSure1").attr("src", "img/success.png");
            }
        }
  • 相关阅读:
    MATLAB符号运算(2)
    ruby的字符串
    MATLAB符号运算(3)
    ruby的lambda
    MATLAB概率统计函数(2)
    ruby的迭代
    MATLAB优化问题(2)
    ruby的方法和block
    MATLAB优化问题(1)
    ruby的正则表达式操作(3)
  • 原文地址:https://www.cnblogs.com/haorensw/p/2415695.html
Copyright © 2020-2023  润新知