zoukankan      html  css  js  c++  java
  • jsp里input中获取当前时间,与WdatePicker配合使用

    <script language="javascript" type="text/javascript" src="${ctx}/js/My97DatePicker/WdatePicker.js"></script>

    <script type="text/javascript">

    <%  
              java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy-MM-dd");
              java.util.Date currentTime = new java.util.Date();//得到当前系统时间
              String str_date = formatter.format(currentTime); //将日期时间格式化 
     %> 

    if($.trim($("#begintime_id").val())!="")
    {
          if($.trim($("#endtime_id").val())=="")
          {
                alert("结束时间不允许为空!");
                return;
          }
    }
    if($.trim($("#endtime_id").val())!="")
    {
          if($.trim($("#begintime_id").val())=="")
          {
                alert("开始时间不允许为空!");
                return;
          }
    }

    </script>

    <input id="begintime_id" name="begintime" type="text" onFocus="WdatePicker({maxDate:'#F{$dp.$D(\'endtime_id\')}'})" readonly="readonly" value="<%=str_date%>" class="Wdate" Style="{86px}"/>

    <input id="endtime_id" name="endtime" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'begintime_id\')}'})" readonly="readonly" type="text" value="<%=str_date%>" class="Wdate" Style="{86px}"/>

  • 相关阅读:
    Git从入门到放弃
    Flex布局
    网络模型与TCP协议
    命令行技巧
    React环境搭建及部署
    Vue环境搭建及部署
    Python 集合set()
    Python-100天代码
    删除Windows启动管理器下的加载项
    windos7操作系统下easyBCD2.3安装Ubuntu18.04.1-desktop-amd64.iso双系统
  • 原文地址:https://www.cnblogs.com/jirglt/p/2969163.html
Copyright © 2011-2022 走看看