一个关于日期选择的很实用的小东西
来源:ASP学习网 作者:Admin 时间:08-06-21 点击:
</table>
<tr bgcolor=#ffffff height=20>
<td width=35 align=center bgcolor=#FFF4F4 style=color:#ff6633>日
<td width=35 align=center bgcolor=#FFF4F4>一
<td width=35 align=center bgcolor=#FFF4F4>二
<td width=35 align=center bgcolor=#FFF4F4>三
<td width=35 align=center bgcolor=#FFF4F4>四
<td width=35 align=center bgcolor=#FFF4F4>五
<td width=35 align=center bgcolor=#FFF4F4>六
<%
if week1<>0 then
response.write "<tr>"
for i=1 to week1
response.write "<td width=35 height=20 bgcolor=#ffffff> "
next
end if
for i=1 to mms
if (i+week1-1) mod 7=0 then response.write "<tr>"
response.write "<td width=35 height=20 align=center bgcolor=#ffffff>"
if cdate(yy & "-" & mm & "-" & i)=date() then
%>
<input type=button value=<%=i%>
style="BORDER:#CD0101 1px groove;width:30;height:16;font-size:9pt;background-color:#FFD9D9;color:#CD0101"
onclick="javascript:getDay('<%=yy%>-<%=mm%>-<%=i%>');" title="<%=yy%>年<%=mm%>月<%=i%>日(今天)">
<%
else
%>
<input type=button value=<%=i%>
style="BORDER:#000000 1px groove;width:30;height:16;font-size:9pt;background-color:#ffffff;color:#000000"
onclick="javascript:getDay('<%=yy%>-<%=mm%>-<%=i%>');" title="<%=yy%>年<%=mm%>月<%=i%>日">
<%
end if
next
if (mms+week1) mod 7<>0 then
for i=1 to (7-((mms+week1) mod 7))
response.write "<td width=35 height=20 bgcolor=#ffffff> "
next
end if
%>
</table><br>
<div align=center><a href="javascript:window.close()">〖关闭本窗口〗</a></div>
</body>
</html>
************************************************************************
调用day.asp页面的代码:
<form name=form1>
<input name=date1 value=<%=date()%> readonly onClick="JavaScript:window.open('day.asp?form=form1&field=date1&oldDate='+this.value,'','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,width=250,height=200,top=220,left=250');"
</form>
************************************************************************
其中,打开day.asp页面时,需要传递几个参数,分别是:
1)form:日期选择框所在的表单名称,本例为form1,可根据应用自行更改
2)field:日期选择框的名称,本例为date1,可根据应用自行更改
3)olddate:日期选择框的当前值,不需改动。
我叫“积木”,欢迎和我成为朋友!
http://www.ecolor99.com/jim
下一篇:利用XMLHTTP无刷新获取数据