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

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

<%@ LANGUAGE="VBSCRIPT" %>
<%
'Code Written by D. Scott Hand
'If any errors are found, please
'e-mail scott_hand@pobox.com with
'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.
'***********************
If Request.Querystring("Page") <> "" Then
   PageName = Request.Querystring("Page")
   Session("PageName") = PageName
Else
   PageName = Session("PageName")
End If
If Request.Querystring("Form") <> "" Then
   FormName = Request.Querystring("Form")
   Session("FormName") = FormName
Else
   FormName = Session("FormName")
End If
If Request.Querystring("Element") <> "" Then
   ElementName = Request.Querystring("Element")
   Session("ElementName") = ElementName
Else
   ElementName = Session("ElementName")
End If
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual InterDev 1.0">
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>Select Date</TITLE>
</HEAD>
<BODY BGColor="#ded6c5" alink="#526B84" vlink="#526B84" onBlur="javascript:self . focus ();">
<SCRIPT LANGUAGE="javascript">
   function calpopulate(dte) {
   window.opener.<%=formname & "." & elementname%>.value = dte;
   self.close()
      }
</SCRIPT>
<%
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" & "/" & _
       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)
%>
<center>
<table>
<tr>
<td colspan="7" align="center">
<hr>
<font size=2><b><%=MonthName(CurrentMonth)%> <%=Year(BuildDate)%></b>
<br>

<%
'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
%>
<a href="DateSelect.asp?BMonth=<%=PreviousMonth%>"><font
size=-2><--Previous</a>
   
<a href="DateSelect.asp?BMonth=<%=NextMonth%>"><font size=-2>Next--></a>

<hr></td>
</tr>
<tr>
<td><font size="-3">Su</td><td><font size="-3">Mo</td><td><font
size="-3">Tu</td><td><font size="-3">We</td><td><font
size="-3">Th</td><td><font size="-3">Fr</td><td><font size="-3">Sa</td>
</tr>
<tr>

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

%>
<td><font size="-3"> </td>
<%
DayPosition=DayPosition+1
Next

Do Until CurrentMonth <> Month(BuildDate)
%>

<%
While DayPosition<>8
%>
<td align="center" <%If Day(BuildDate)=Day(Now) Then Response.Write "bgcolor=""#FFFFFF"""%>
calpopulate('" & Month(BuildDate) & "/" & Day(BuildDate) & "/" & Right(Year
(BuildDate),2)%>')"><font size="-3">

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

</tr><tr>
<%
Loop
%>
</tr>
</table>
</center>
</BODY>
</HTML>

时间: 2024-08-01 12:19:15

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

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

TestCal.asp <HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft Visual InterDev 1.0"> <META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1"> <TITLE>Test Calendar D

c#如何实现一个线程暂停,等待用户输入文本后继续运行?

问题描述 情问如何等待一个用户输入文本然后输入超过4位后继续根据用户输入的数值继续运行程序?Suspend过时了我不知道还有其他方法实现?? 解决方案 解决方案二:可以用事件通知:usingSystem;usingSystem.Text;usingSystem.Windows.Forms;usingSystem.Threading;namespaceWindowsApplication1{publicpartialclassForm1:Form{publicForm1(){InitializeC

if else判断用户输入

问题描述 怎样用if--else语句写一个判断用户输入的是数字还是字符串,急,谢谢 解决方案 解决方案二:JS用内置函数:isNaN解决方案三:importjavax.swing.*;publicclassLast27{publicstaticvoidmain(Stringargs[]){int[]a=newint[10];Stringcount="0123456789";for(inti=0;i<10;i++){Stringimput=JOptionPane.showInput

numbers-如何让用户输入一个数字,然后分辨是比array里面的数字大还是小

问题描述 如何让用户输入一个数字,然后分辨是比array里面的数字大还是小 import java.util.Scanner; public class Arrays13 { public static void main(String[] args) { Scanner reader = new Scanner(System.in); int number; int[] numbersArray = new int[]{11,8,4,9,22,30,24,23,35,0}; System.ou

jsp页面-JSP页面登陆,一个账号文本框不管用户输入的是手机/邮箱都可以登陆

问题描述 JSP页面登陆,一个账号文本框不管用户输入的是手机/邮箱都可以登陆 解决方案 select * from table where @userinput = (phone or @userinput = email) and @password = pwd用类似这样的查询,or一下就可以了.假设userinput和password是输入 解决方案二: 做下判断就好了,有@和.com的字符串是邮箱,11位数字的书是手机号,其他的情况是用户名.需要注意的是在注册的时候用户名不能有@符号. 就

字符处理-判断用户输入的是一个单词,还是多个单词,用什么方法好点

问题描述 判断用户输入的是一个单词,还是多个单词,用什么方法好点 判断一个用户的输入是一个单词,还是多个单词,是去判断里面的空格好呢,还是用正则去判断... 解决方案 判读空格吧 正则表达式不好进行判断 解决方案二: 感觉判断里面的空格好,两空格之间有值的为一个单词,比较通用-- 解决方案三: 用空格比较简单一些 复杂的匹配要求可以用正则 解决方案四: 用正则不是还是判断是不是有空格么 s 难道还有别的 解决方案五: 如果没有什么特殊的要求,用空格来判断比较好! 解决方案六: 一般编程语言中包含

c语言-声明一个数组,由用户输入数组长度。不赋初值不报错,赋初值就报错?为什么

问题描述 声明一个数组,由用户输入数组长度.不赋初值不报错,赋初值就报错?为什么 基本上,代码如下: #include<stdio.h> int main(){ int num = 0; printf(""输入数组长度:""); scanf(""%d""&num); int arr[num]; //编译不报错 //int arr[num] = {0}://编译报错 return 0;} 解决方案 因为C语言

VB.NET WEB页面中,有一个Textbox框,我让用户输入的是2008/12/06 类似的日期,如何判断用户输入的正确性!

问题描述 VB.NETWEB页面中,有一个Textbox框,我让用户输入的是2008/12/06类似的日期,如何判断用户输入的正确性!如果不正确,则给出一个提示,并让光标仍然停留在textbox中并全选.请问如何做呢?谢谢! 解决方案 解决方案二:你这样很难验证,情况太多了,为何不用时间控件呢.AjaxToolkit中的Canlender控件,可以设定时间格式,不用自己验证了,而且很容易设置.解决方案三:用CompareValidator验证控件!!解决方案四:验证控件方便些解决方案五:这是一个

编写一个java代码接受用户输入的账号和密码 给三次机会。但是运行后输入后显示错误。

问题描述 编写一个java代码接受用户输入的账号和密码 给三次机会.但是运行后输入后显示错误. package www; import java.awt.*; import javax.swing.*; import java.awt.event.*; public class SwingJFrame extends JFrame implements ActionListener{ JLabel jb1=new JLabel("输入帐号:"); JLabel jb2=new JLab