日期:2014-05-16 浏览次数:20534 次
<%
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, -1);
SimpleDateFormat sf = new SimpleDateFormat("yyyy-MM-dd");
String newTime = sf.format(cal.getTime());
%>
<form id="taizhytk" name="taizhytk" method="post" class="checkout" action="">
<div>
<table>
<tr>
<td>
查询时间:
<input id="begintime" name="begintime" type="text" onclick="WebCalendar.start(this, 'yyyy-MM-dd')"
value="<%=newTime %>" maxlength="20" style="width:80px" readonly/>
<input type="button" name="to_select" id="to_select" value="查 询"/>
</td>
</tr>
</table>
</div>
<div>
<tr>
<th nowrap="nowrap" colspan="7" width="90%" background="<c:url value="/images/head.gif"/>">
<font color="bule" style="font-size: 13pt" >[color=#FF0000]日期[/color]
</font></th>
</tr>
</div>
<form>
<script type="text/javascript">
function setDateValue(){
var dateHtml = '[color=#FF0000]'+ document.getElementById('begintime').value+'[/color]';
document.getElementByTagName('font').get(0).innerHtml = dateHtml;
}
<input type="button" name="to_select" id="to_select" value="查 询" onclick="setDateValue();" />