?? dateb.jsp~4~
字號:
<%@ page contentType="text/html; charset=GB2312" %>
<html>
<head>
<title>
dateb 日期的比較
</title>
</head>
<body>
<script>
//時間比較函數
function compdate(){
var a,ass,aD,aS;
var b,bss,bD,bS;
a=document.create.Inject_Cycle2.value; //得到簽約時間;
b=document.create.Cycle2.value; //得到內容制作時間;
ass=a.split("-"); //以"-"分割字符串,返回數組;
aD=new Date(ass[0],ass[1],ass[2]); //格式化為Date對像;
aS=aD.getTime(); //得到從 1970 年 1 月 1 日開始計算到 Date 對象中的時間之間的毫秒數
bss=b.split("-");
bD=new Date(bss[0],bss[1],bss[2]);
bS=bD.getTime();
if(bS>aS){
alert("發布時間不能超過簽約時間");
create.Cycle2.focus();
return false;
}
}
</script>
<form action="" method="post" name="create" id="create">
<table width="100%" height="87" border="0" cellpadding="0" cellspacing="3">
<tr>
<td width="25%" align="right">合約時間:</td>
<td width="75%"><input name="Inject_Cycle2" type="text" id="Inject_Cycle2" value="2006-09-05" size="10" >
</td>
</tr>
<tr>
<td align="right" ><span class="STYLE1">制作內容時間:</span></td>
<td colspan="2"><input name="Cycle2" type="text" id="Cycle2" value="2006-10-10" size="10">
</td>
</tr>
<tr>
<td align="right" > </td>
<td colspan="2"><input type="button" name="Submit" value="提交" onclick="compdate();"></td>
</tr>
</table>
</form>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -