一个提供用户输入时期的绝好程序之(二)

2018-09-06 11:35

阅读:394

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

<%@ LANGUAGE=VBSCRIPT %>
<%
Code Written by D. Scott Hand
If any errors are found, please
the error and the way the error
was caused
***Purpose:************
* This is a page built to show calendar functionality.
* Description:
* This is the instantiated file toto
* allow the user to select a date.
***********************
Then
PageName = Request.Querystring(Page)
Session(PageName) = PageName
Else
PageName = Session(PageName)
End If
Then
FormName = Request.Querystring(Form)
Session(FormName) = FormName
Else
FormName = Session(FormName)
End If
Then
ElementName = Request.Querystring(Element)
Session(ElementName) = ElementName
Else
ElementName = Session(ElementName)
End If
%>








function calpopulate(dte) {
window.opener.<%=formname . elementname%>.value = dte;
self.close()
}

<%
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

Then
BuildDate = BMonth / 1 / _
Request.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)
%>








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

1 then
PreviousMonth=CurrentMonth-1 BYear= Year(BuildDate)
Else
PreviousMonth= 12BYear= Year(DateAdd (yyyy, -1, BuildDate))
End If
%>
<font


评论


亲,登录后才可以留言!