|
-
June 27th, 2002, 02:48 PM
#1
Member
Stop Function in JAVA SCRIPT HELP!
Well here is what I have I basically got it working the way it should except for I can't make the function stop. after the timer hits 30 minutes it send the alert, but it keeps sending the alert I want it to halt all processes there, but I can't find the code? Any ideas?
Thanks
-=LB=-
<HTML>
<SCRIPT LANGUAGE="Javascript"><!--
var z = 0
var x = 0
var y = 1
function startClock(){
x = x+y
document.frm.txtcount1.value = x
document.frm.txtcount2.value = z
setTimeout("startClock()", 1000)
if(x==60){
z=z+1
x=0 }
if(z==30){
alert(txttick1);
document.frm.focus
}
}
function stopClock() {
x=0
z=0
document.frm.txtcount1.value = ""
document.frm.txtcount2.value = ""
}
//--></SCRIPT>
<TABLE>
<TR>
<TD></td>
<TD>Ticket Number</td>
<TD><center>Submit Time</center></td>
<TD>Minutes Seconds</td>
</tr>
<TR>
<TD>
<INPUT TYPE="BUTTON" SIZE=10 NAME="button0" VALUE="START"> </td>
<TD><center>
<INPUT TYPE="TEXT" NAME="txttick1" READONLY SIZE=6 VALUE="">></center> </td>
<TD><center>
<INPUT TYPE="TEXT" NAME="txttime1" READONLY SIZE=17 VALUE="">></center> </td>
<td>
<FORM NAME="frm">
<INPUT TYPE="TEXT" NAME="txtcount2" READONLY SIZE=2 VALUE="">>
<INPUT TYPE="TEXT" NAME="txtcount1" READONLY SIZE=2 VALUE="">>
</FORM>
</td>
</tr>
<tr>
<td>
<INPUT TYPE="BUTTON" SIZE=10 NAME="button1" VALUE="CLEAR"></td>
</table>
<SCRIPT LANGUAGE="VBScript" >
Sub button0_onclick
ticketnum = InputBox("Please enter the ticket number to be tracked.")
txttick1.value=ticketnum
txttime1.value=now
startClock()
End Sub
Sub button1_onclick
txttick1.value=""
txttime1.value=""
End sub
</SCRIPT >
</HTML>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|