
06.01.2008, 11:38
|
|
Reservists Of Antichat - Level 6
Регистрация: 19.03.2007
Сообщений: 953
Провел на форуме: 7617458
Репутация:
3965
|
|
У меня есть скрипт - таймер. И формочка, батон.
PHP код:
<HTML>
<HEAD>
<TITLE>Timer</TITLE>
</HEAD>
<Script Language="JavaScript">
<!-- Hiding
/* Script By Lefteris Haritou
http://www.geocities.com/~lef
Please Keep The Credit Above
No Copyrights but be fair
*/
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
document.forms.w1.w2.value="Часу залишилося: "+m+":"+s
window.setTimeout("checktime()",1000)
}
function settimes(){
alert("You have 20 minutes time !")
var time= new Date();
hours= time.getHours();
mins= time.getMinutes();
secs= time.getSeconds();
etime=hours*3600+mins*60+secs;
etime+=10; //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("Time expired");
}
// Done hiding -->
</Script>
<BODY onLoad="settimes()">
<!-- following code added by server. PLEASE REMOVE -->
<!-- preceding code added by server. PLEASE REMOVE -->
<Center><H2>Look in the status bar. In 20 mins you will be forced to change page</H2>
</Center>
<form name="w1">
<input type="text" name="w2">
</form>
<form name=qw method=post action=./index1.php><input type=text name=an ><input type=submit name=ok></form>
</BODY>
</HTML>
Как сделать так, чтоб когда выходить время нажималась кнопка сабмит?
Почемуто неработает так:
PHP код:
document.forms.qw=submited;
__________________
BlackHat. MoDL
|
|
|