首页 > Web开发 > 详细

jsp里input中获取当前时间,与WdatePicker配合使用

时间:2015-06-25 15:42:00      阅读:337      评论:0      收藏:0      [点我收藏+]

<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="{width: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="{width:86px}"/>

jsp里input中获取当前时间,与WdatePicker配合使用

原文:http://blog.csdn.net/tfy1332/article/details/46635831

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!