zoukankan      html  css  js  c++  java
  • webfrom 做项目的注意事项

    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;
            }
        }
  • 相关阅读:
    训练20191009 2018-2019 ACM-ICPC, Asia East Continent Finals
    [学习笔记] 有上下界网络流
    [HDU4609] 3-idiots
    [HDU1402] A * B Problem Plus
    [HNOI2017] 礼物
    训练20191007 2017-2018 ACM-ICPC Latin American Regional Programming Contest
    [ZJOI2014] 力
    训练20191005 2017-2018 ACM-ICPC Asia East Continent League Final
    [一本通学习笔记] 树链剖分
    [一本通学习笔记] 快速幂
  • 原文地址:https://www.cnblogs.com/big-lll/p/6940727.html
Copyright © 2011-2022 走看看