<SCRIPT language="JavaScript">
<!--
function display(){
rtime=etime-ctime;
if (rtime>60)
m=parseInt(rtime/60);
else{
m=0;
}
s=parseInt(rtime-m*60);
if(s<10)
s="0"+s
window.status="时间还剩 : "+m+":"+s
window.setTimeout("checktime()",1000)
}
function settimes(){
var shij=document.Form1.tb1.value;
alert("开始考试!")
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
etime=hours*3600+mins*60+secs;
etime+=shij*60; //You can change the value of 1200 according to how much time you wish to set the timer. Where 1200 is time in secs (1200 = 20 mins * 60 secs/min). Max time is 60 mins (3600secs)
checktime();
}
function checktime(){
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
ctime=hours*3600+mins*60+secs
if(ctime>=etime){
expired();
}
else
display();
}
function expired(){
alert("交卷时间已到了,系统将自动交卷");
//document.Form1.submit;
document.Form1.Button2.click;
//location.href="score.aspx"; //Put here the next page
}
document.oncontextmenu=settimes();
// Done hiding -->
</SCRIPT>
document.Form1.Button2.click;为什么这句没有作用啊??????
要怎么样才可以?
<!--
function display(){
rtime=etime-ctime;
if (rtime>60)
m=parseInt(rtime/60);
else{
m=0;
}
s=parseInt(rtime-m*60);
if(s<10)
s="0"+s
window.status="时间还剩 : "+m+":"+s
window.setTimeout("checktime()",1000)
}
function settimes(){
var shij=document.Form1.tb1.value;
alert("开始考试!")
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
etime=hours*3600+mins*60+secs;
etime+=shij*60; //You can change the value of 1200 according to how much time you wish to set the timer. Where 1200 is time in secs (1200 = 20 mins * 60 secs/min). Max time is 60 mins (3600secs)
checktime();
}
function checktime(){
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
ctime=hours*3600+mins*60+secs
if(ctime>=etime){
expired();
}
else
display();
}
function expired(){
alert("交卷时间已到了,系统将自动交卷");
//document.Form1.submit;
document.Form1.Button2.click;
//location.href="score.aspx"; //Put here the next page
}
document.oncontextmenu=settimes();
// Done hiding -->
</SCRIPT>
document.Form1.Button2.click;为什么这句没有作用啊??????
要怎么样才可以?
解决方案 »
- 求救。。。VS调试无反应
- 网页获取浏览者本机进程
- 身份验证
- 求高手指导下ComponentArt提供的Grid的用法,谢谢了!
- 请求高手帮助?
- 最近要研究一门叫Grammar Definition Language的语言,玩过的兄弟给点资料,谢谢!
- 请教ADO.NET高手:怎样在Asp.Net中添加、读取、修改Access字段的Description(说明)内容?
- 如何对datagrid模板列中dropdownlist进行绑定?
- 求救!能不能上班就看各位好心人了!高分!
- 重新加载的控件为何第一次初始化IsPostBack就为True?? 请各位帮忙~~~急
- 在《亲密接触asp.net》书中写连sql server的语句是“server=(local);database= ;Trusted_Connection=yes”可我试着不行,用其它的一句
- (ASP.NET)把EXCEL文件读入DATASET中出现:Microsoft Jet 数据库引擎打不开文件'C:\Documents and Settings\Administrator\My Documents\W
document.Form1.submit();
有作用吗?document.Form1.Button2.click;为什么这句没有作用啊??????
Button2的click事件存在吗?
Button2是HTML控件。
你能给个解决方案吗?