<s:datetimepicker id="scheduleDate" name="scheduleDate" type="date" displayFormat="yyyy-MM-dd"></s:datetimepicker>
如何让日期框框里就默认显示出当天日期,然后点击那个按钮时弹出的当月日历(这个可以正常显示出来)。就是默认时还没有选择具体的日期时就在前面的框框中显示当天日期。
------解决方案--------------------
value="today" 试试
------解决方案--------------------
- Java code
<script type="text/javascript"> var timerID = null; var timerRunning = false; function stopclock (){ if(timerRunning){ clearTimeout(timerID); timerRunning = false; } } function startclock(){ stopclock(); showtime(); } function showtime(){ var now= new Date(); var year=now.getYear(); var month=now.getMonth()+1; var day=now.getDate(); var hour=now.getHours(); var minute=now.getMinutes(); var second=now.getSeconds(); var timeValue =year+"-"+month+"-"+day+" "+hour+":"+minute+":"+second; document.getElementsByName("XXX")[0].value = timeValue; timerID = setTimeout("showtime()",1000); timerRunning = true; } </script><body onload="startclock()">