共六个文件
1。calendar.htm
2。selectdate.html
3。getdate.asp
4。calendar.js
5。cele_date.js
6。fpopupcalendardlg.js
下面为具提代码
1。calendar.htm
<html><head><title>日期选择</title>
<meta content="text/html; charset=gb2312" http-equiv=content-type>
<meta content="mshtml 5.00.2014.210" name=generator></head>
<script src="calendar.js"></script>
<body bgcolor=#3366cc onload=fload()>
<script>
function fload()
{
fpopcalendar(document.all.txt1, document.all.txt1);
}
function fkeydown()
{
if(event.keycode==27){
event.returnvalue = null;
window.returnvalue = null;
window.close();
}
}
document.onkeydown=fkeydown;
</script>
<input id=txt1 style="display: none"> </body></html>
2。selectdate.html
<html><head><title>date</title>
<meta content="text/html; charset=gb2312" http-equiv=content-type>
<script language=javascript src="cele_date.js"></script>
<script src="fpopupcalendardlg.js"></script>
<script language=javascript>
function timecheck(){
with (document.form1)
{
if (v_datebegin.value=="")
{
alert("起始时间选择不能为空!");
v_datebegin.value="2002-1-1";
}
else
{
if (v_dateend.value=="")
{
alert("结束时间选择不能为空!");
v_dateend.value="2002-12-31";
}
else
{
submit();
}
}
}
}
</script>
</head>
<body bgcolor=#ffffff>
<form action=getdate.asp id=form1 method=post name=form1>
从 <input maxlength=10 name=v_datebegin size=10
value=2002-5-3> <input name=button12 onclick="fpopupcalendardlg(v_datebegin);return false" type=button value=">>">
到 <input maxlength=10 name=v_dateend size=10
value=2002-5-23> <input name=button13 onclick="fpopupcalendardlg(v_dateend);return false" type=button value=">>">
<input id=submit1 name=submit1 onclick=timecheck() type=button value="查 询">
</body></html>
3。getdate.asp
你选择的日期:从<%=request.form("v_datebegin")%> 到<%=request.form("v_dateend")%>
由于比较长,下一帖继续
演示: http://www.cnaspol.com/selectdate/selectdate.html
