zoukankan      html  css  js  c++  java
  • 年月日控件

    <select id="Year" name="Year" class="sys_selectB mr10">
    </select>
    <select id="Month" name="Month" class="sys_selectB mr10">
    </select>
    <select id="Day" name="Day" class="sys_selectB mr10">
    </select>
    

      


    $("#City").change(function () {
    if ($("#City").val() != "0")
    Biz.Customer.Register.buildWarningMessage(jQuery("#City"), 0);
    });
    for (var y = 2014; y > 1960; y--) {
    $("#Year").append(jQuery("<option></option>").val(y).html(y));
    }
    for (var m = 1; m < 13; m++) {
    $("#Month").append(jQuery("<option></option>").val(m).html(m));
    }
    InitDays($("#Year").val(), $("#Month").val());
    $("#Year,#Month").bind("change", function () {
    InitDays($("#Year").val(), $("#Month").val());
    }); 
    
    function TGetDaysInMonth(iMonth, iYear) {
    var dPrevDate = new Date(iYear, iMonth, 0);
    return dPrevDate.getDate();
    }
    function InitDays(iYear, iMonth) {
    var dDate = new Date(),
    daysInMonth = TGetDaysInMonth(iMonth, iYear),
    str = "";
    $("#Day").empty();
    for (var d = 1; d <= parseInt(daysInMonth); d++) {
    if (d == dDate.getDate()) {
    str = "<option value=" + d + " selected=true>" + d + "</option>";
    } else {
    str = "<option value=" + d + ">" + d + "</option>";
    }
    $("#Day").append(str);
    }
    } 
    

      

  • 相关阅读:
    java导出pdf格式文档
    本地文件夹选择框
    将文件解除占用
    Windows 进入上帝模式窗口
    Windows 10 系统获取密钥方法
    CentOS7 systemctl 命令
    一键立即息屏
    定时关闭程序
    CentOS 7 FTP的安装与配置
    SQL基础
  • 原文地址:https://www.cnblogs.com/bober/p/3657978.html
Copyright © 2011-2022 走看看