• 做webform注意事项 闰年日期


    1、展示细节

    如男女显示问题 不能显示true   false  时间转换成中文  民族显示汉字  不能直接显示代码
    2、用户名重复验证

    从数据库中查询验证
    4、日期判断

    判断年份有点问题

     var year = document.getElementById("Dr_Year");
        var mon = document.getElementById("Dr_Month");
        var day = document.getElementById("Dr_Day");
        document.getElementById("Dr_Year").onchange = function () {
            
            if (mon.value == "2")
            {
                if (this.value % 4 == 0)
                {
                    day.options.length = 0;
                    for (var i = 1; i < 30; i++)
                    {
                        var op = document.createElement("option");
                        op.value = i;
                        op.innerHTML = i;
                        day.appendChild(op);
                    }
    
                }
                else {
                    day.options.length = 0;
                    for (var i = 1; i < 29; i++) {
                        var op = document.createElement("option");
                        op.value = i;
                        op.innerHTML = i;
                        day.appendChild(op);
                    }
                }
    
            }
        }
        document.getElementById("Dr_Month").onchange = function () {
            
            if (this.value == "2") {
                if (year.value % 4 == 0) {
                    day.options.length = 0;
                    for (var i = 1; i < 30; i++) {
                        var op = document.createElement("option");
                        op.value = i;
                        op.innerHTML = i;
                        day.appendChild(op);
                    }
    
                }
                else {
                    day.options.length = 0;
                    for (var i = 1; i < 29; i++) {
                        var op = document.createElement("option");
                        op.value = i;
                        op.innerHTML = i;
                        day.appendChild(op);
                    }
                }
            }
            else if (this.value == "1" || this.value == "3" || this.value == "5" || this.value == "7" || this.value == "8" || this.value == "10" || this.value == "12") {
                day.options.length = 0;
                for (var i = 1; i < 32; i++) {
                    var op = document.createElement("option");
                    op.value = i;
                    op.innerHTML = i;
                    day.appendChild(op);
                }
    
            } else {
                day.options.length = 0;
                for (var i = 1; i < 31; i++) {
                    var op = document.createElement("option");
                    op.value = i;
                    op.innerHTML = i;
                    day.appendChild(op);
                }
            }
        }


    5、修改页面无法提交


    6、编辑时,如密码不填,则保留原有密码

    一般都是单独改密码    统一改的时候在修改方法里面加一个判断 

    执行语句 如果密码为空则不修改密码 

    密码不为空在修改

    用js判断密码是否一致

    var p1 = document.getElementById("TextBox2");
        var p2 = document.getElementById("TextBox3");
    
        p1.onkeyup = function () { pwdisok(p1, p2); }
        p2.onkeyup = function () { pwdisok(p1, p2); }
    
        function pwdisok(pwd1, pwd2) {
            if (pwd1.value != pwd2.value) {
                document.getElementById("pwd_error").innerText = "两次密码不一致!";
                document.getElementById("pwd_error").style.color = "red";
                pwdok = false;
            }
            else {
                document.getElementById("pwd_error").innerText = "正确!";
                document.getElementById("pwd_error").style.color = "green";
                pwdok = true;
            }
        }
  • 相关阅读:
    Mybatis <set>标签
    Mybatis <where>标签
    Mybatis choose (when, otherwise)标签
    Mybatis <if>标签
    Mybatis <Sql>标签
    Mybatis配置详解
    [转]在浏览器的标签页显示网站标志图标(或指定图标)的方法
    【转】如何建立一个样式新颖的CSS3搜索框
    【转】css布局居中和CSS内容居中区别和对应DIV CSS代码
    作业:按钮控制打开关闭新窗口及新窗口按钮关闭父窗口
  • 原文地址:https://www.cnblogs.com/v587yy/p/6888456.html
Copyright © 2020-2023  润新知