欢迎光临爱时尚女性网
 

一个提供用户输入时期的绝好程序

2012-7-30 编辑:knwz 来源:爱时尚女性网 阅读次数:760
  导读:TestCal.asp Test Calendar Date Selection { self.name="BODY"; } function calpopup(lnk) { window.open(lnk, "calendar","height=250,width=250,scrollbars=no") }   View application des...
TestCal.asp





Test Calendar Date Selection










onClick="calpopup('DateSelect.asp?Page=BODY&Form=DataEntry&Element=FromDate')">



 






View
application description.






DateSelect.asp 创立一个日历格式的。。。

<%@ LANGUAGE="VBSCRipT" %>
<%
'***Purpose:************
'* This is a page built to show calendar functionality.
'* Description:
'* This is the instantiated file toto
'* allow the user to select a date.
'***********************
If Request.Querystring("Page") <> "" Then
燩ageName = Request.Querystring("Page")
爏ession("PageName") = PageName
Else
燩ageName = Session("PageName")
End If
If Request.Querystring("Form") <> "" Then
燜ormName = Request.Querystring("Form")
燬ession("FormName") = FormName
Else
燜ormName = Session("FormName")
End If
If Request.Querystring("Element") <> "" Then
燛lementName = Request.Querystring("Element")
燬ession("ElementName") = ElementName
Else
燛lementName = Session("ElementName")
End If
%>




Select Date



<%
If IsDate(Request.QueryString("Date")) Then
BuildDate=Request.QueryString("Date")
Else


If Request.Querystring("BMonth") = "" Then
BMonth = Month(Now)
Else
BMonth = Request.Querystring("BMonth")
End If

If Request.QueryString("BYear") <> "" Then
BuildDate = BMonth & "/" & "1" & "/" & _
燫equest.QueryString("BYear")
Else
BuildDate = BMonth & "/" & "1" & "/" & Right(Year(Now), 2)
End If

End If
Session("CurrentDate")=BuildDate


'This gives the position of weekday for that date
BuildDayValue = Weekday(BuildDate)

CurrentMonth = Month(BuildDate)
%>











<%
DayPosition=1
'Now loop through table build with blanks until first day of month
'is in position
For I = 1 to BuildDayValue-1
%>

<%
DayPosition=DayPosition+1
Next

Do Until CurrentMonth <> Month(BuildDate)
%>

<%
While DayPosition<>8
%>

<%
DayPosition=DayPosition+1
BuildDate=DateAdd("d", 1, BuildDate)
If CurrentMonth <> Month(BuildDate) then
DayPosition=8
End If
Wend
DayPosition=1
%>


<%
Loop
%>




<%=MonthName(CurrentMonth)%> <%=Year(BuildDate)%>



<%
'BuildDate=DateAdd("d", -1, BuildDate)
If CurrentMonth < 12 then
NextMonth=CurrentMonth+1 & "&BYear=" & Year(BuildDate)
Else
NextMonth="1&BYear=" & Year(DateAdd ("yyyy", 1, BuildDate))
End if

If CurrentMonth > 1 then
PReviousMonth=CurrentMonth-1 & "&BYear=" & Year(BuildDate)
Else
PreviousMonth= "12&BYear=" & Year(DateAdd ("yyyy", -1, BuildDate))
End If
%>
size=-2><--Previous
   
Next-->

SuMo size="-3">TuWe size="-3">ThFrSa
 
onClick="<%Response.Write "calpopulate('" & Month(BuildDate) & "/" & Day(BuildDate) & "/" & Right(Year
(BuildDate),2)%>')">

<%=Day(BuildDate)%>




文章出自:爱时尚女性网www.aspjc.com,尊重版权是美德,转载请保留原地址,感谢合作!

 
 
链接交换请联系:QQ:790646582 首页链接要求百度快照在一周以内,不符合以上要求的各站,我们将定期把友情连接转入内页,谢谢合作。
Copyright @ 2012-2015 爱时尚女性网 保留所有权利吉ICP备14005127号-1 服务QQ:175529508 e-mail:zk8312@163.com
本站部分资源来自网友上传,如果无意之中侵犯了您的版权,请联系本站,本站将在3个工作日内删除。