Foxtable(狐表)用户栏目专家坐堂 → 手机版如何根据出生日期计算年龄


  共有1860人关注过本帖树形打印复制链接

主题:手机版如何根据出生日期计算年龄

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/11/30 15:50:00 [显示全部帖子]

填写出生日期日期以后生成年龄?

 

Select Case e.Path
    Case "test.htm",""
        Dim wb As New WeUI
        wb.AddForm("","form1","addnew.htm")
        With wb.AddInputGroup("form1","ipg1","客户资料")
            .AddInput("姓名","姓名","Text") '前一个"姓名"是ID,后一个"姓名"是标题
            .AddInput("日期","日期","date").attribute = "onchange=""var r = this.value.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1,2})$/);if(r==null) return;var d= new Date(r[1], r[3]-1, r[4]); if(d.getFullYear()==r[1]&&(d.getMonth()+1)==r[3]&&d.getDate()==r[4]){ var Y = new Date().getFullYear(); 年龄.value = Y-r[1];}"""
            .AddInput("年龄","年龄","number")
        End With
        With wb.AddButtonGroup("form1","btg1",True)
            .Add("btn1", "确定", "submit")
        End With
        e.WriteString(wb.Build)
End Select


 回到顶部