非常好用的日期选择器,建议入精华 <一> 有演示

发表于:2007-06-30来源:作者:点击数: 标签:
共六个文件 1。calendar.htm 2。selectdate.html 3。getdate.asp 4。calendar.js 5。cele_date.js 6。fPopUpCalendarDlg.js 下面为具提代码 1。calendar.htm HTMLHEADTITLE日期选择/TITLE META content=text/html; charset=gb2312 http-equiv=Content-Type ME
共六个文件
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=#3366clearcase/" target="_blank" >cc 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

原文转自:http://www.ltesting.net