求新的年月日,急!
输入一个新年月日,加上一个固定月份,产生一个新月份。实验几次不成功,希望大家指导一下,代码如下:<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<script language="javascript">
function price1(){
var a;
var b;
var price;
a=document.form1.ordernum.value;
b=document.form1.saleprice.value;
price=<%=DateAdd("m",b,cdate(a))%>;
document.form1.price.value=price;
}
</script>
<form name="form1" method="post" action="">
<table width="560" border="0" align="center" cellpadding="5" cellspacing="0">
<tr>
<td width="70"><input name="ordernum" type="text" id="ordernum" onBlur="price1()" size="10"></td>
<td width="97"><div align="right">固定月份</div></td>
<td width="174"><input name="saleprice" type="text" id="saleprice" value="6" size="6" readonly="yes">
</tr>
<tr>
<td><div align="right">新年月日:</div></td>
<td colspan="3"><input name="price" type="text" id="price" size="20" readonly="yes" ></td>
</tr>
<tr>
<td colspan="4"><div align="center">
<input type="submit" name="Submit2" value="确定">
</div></td>
</tr>
</table>
</form>
</body>
</html>