asp 日期加减,请高手指点。(sdate2 无输出)
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<%dim sdate1, sdate2, sdays
sdate1 = request.form("date1")
sdays = cint(request.form("days"))
if sdate1<>"" and isdate(sdate1) and sdays<>"" and isnumeric(sdays) then
sdate2 = dateadd("d",sdays,sdate1)
end if
%>
<script language="JavaScript">
<!-- Begin
var enable=0;
today=new Date();
var day;
var date;
var time_start = new Date();
var clock_start = time_start.getTime();
if(today.getDay()==0) day="星期日"
if(today.getDay()==1) day="星期一"
if(today.getDay()==2) day="星期二"
if(today.getDay()==3) day="星期三"
if(today.getDay()==4) day="星期四"
if(today.getDay()==5) day="星期五"
if(today.getDay()==6) day="星期六"
date=(today.getYear())+"年"+(today.getMonth()+1)+"月"+today.getDate()+"日 ";
document.write("<span style='font-size: 9pt;color:#000000;'>"+date);
document.write(day+"</font></span>");
// -->
</script>
<script language="JavaScript">
function autoje(){
if (form1.days.value==0)
{alert("请输入天数!");form1.days.focus();return;}
if (isNaN(form1.days.value))
{alert("您输入的不是有效值(请输入0-9之间的数)!");form1.days.focus();return;}
;}
</script>
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<p>a
<label>
<input name="date1" type="text" id="date1" />
</label>
</p>
<p>b
<label>
<input name="days" type="text" id="days" onblur="autoje()" size="13" onkeyuu="if(event.keycode==13){autoje()}" />
</label>
</p>
<p>c
<label>
<input name="date2" type="text" id="date2" value="<%=sdate2%>" />
</label>
</p>
</form>
</body>
</html>