当前页面: 开发资料首页 → Java 专题 → 到时提交表单
到时提交表单
摘要: 到时提交表单
</td>
</tr>
<tr>
<td height="35" valign="top" class="ArticleTeitle">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100" height="100" align="center" valign="top">
</td>
<td width="57%" valign="top">
到时提交表单的JS代码,
在网上搜索,整理得。
<head>
电子钟
</head>
<script type="text/JavaScript">
</td>
</tr>
<tr>
<td height="44" colspan="2">
var timerRunning=false;
var timerID=null;
function stopclock(){
if(timerRunning)
clearTimerout(timerID);
timerRunning=false;
}
function startclock(){
stopclock();
showtime();
}
var flag=0;
var TimeGetF=1;
var TimeNum=125;
var TimeNumF,TimeNumM;
function showtime(){
TimeNum--;
TimeNumF=TimeNum/60;
TimeNumM=TimeNum%60;
/* if(TimeNumF<10&&TimeNumM==0&&flag<2)
{
alert("只剩下"+Math.floor(TimeNumF)+"分!请抓紧时间!");
flag++;
}else if(TimeNumF<5&&TimeNumM==0&&flag<5)
{
alert("只剩下"+Math.floor(TimeNumF)+"分!请提交试卷!");
flag++;
}*/
if(TimeNum<0)
{
document.forms[1].submit();
}
var timeValue=" "+"你考试的时间还剩"+Math.floor(TimeNumF)+"分"+TimeNumM+"秒";
document.clock.face.value=timeValue;
timerID=setTimeout("showtime()",1000);
timerRunning=true;
}
</script>
<body onload="startclock()">
<form name="clock" onsubmit="0">
<input type="text" name="face" size="30" value>
</form>
欢迎访问java学习室
<form name="scjp" action="dd.jsp" method="post">
用户名: <input type="text" name="username" size="20">
口令:<input type="password" name="pass" size="20">
<input type="Submit" value="提交">
</form>
</body>
</td>
</tr>
</table>
function TempSave(ElementID)
{
CommentsPersistDiv.setAttribute("CommentContent",document.getElementById(ElementID).value);
CommentsPersistDiv.save("CommentXMLStore");
}
function Restore(ElementID)
{
CommentsPersistDiv.load("CommentXMLStore");
document.getElementById(ElementID).value=CommentsPersistDiv.getAttribute("CommentContent");
}
</td>
</tr>
<tr>
↑返回目录
前一篇: Mysql与JSP网页中文乱码问题的解决方案
后一篇: 四个有用的过虑器