.NET Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgramming.NET Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 28th, 2001, 03:12 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
timer in asp

<i><b>Originally posted by : mani</b></i><br />i want to place the timer in asp page such that whenever i submit the button it will show the continuous time ...i mean it should not start again<br />

Reply With Quote
  #2  
Old March 29th, 2001, 04:42 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : Mage (mage@baltnet.ru)</b></i><br />Just copy this code in a new HTML file and launch it. Here we go:<br /><br /><HTML><HEAD><br /><SCRIPT LANGUAGE="JScript"><br /><!--<br />var s=0; // Your timer variable<br />var started=false; // You can start the timer only once<br /><br />function timerSub()<br />{<br />if (!started) {<br /> iTimerID= window.setInterval("yourF()",1000);<br /> started = true;<br /> }<br />}<br />function yourF() {<br />s=s+1;<br />document.forms(0).name.value = s;<br />}<br />//--><br /></SCRIPT><br /></HEAD><br /><BODY><br /><form><br /><input disabled name="name" value="Hello!"><br><br /><input type="button" onclick="timerSub()" value="Start timer"><br /></form><br /></BODY><br /></HTML><br />*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-<br />Or if you need real time use this function:<br /><br />function yourF() {<br /> var d, s;<br /> d = new Date();<br /> s = d.getHours() + ":";<br /> s += d.getMinutes() + ":";<br /> s += ((d.getSeconds()<10) ? "0" + d.getSeconds() : d.getSeconds());<br /> document.forms(0).name.value = s;<br />}<br /><br />Best regards,<br />Mage<br /><br />------------<br />mani at 3/28/2001 1:12:44 AM<br /><br />i want to place the timer in asp page such that whenever i submit the button it will show the continuous time ...i mean it should not start again<br />

Reply With Quote
  #3  
Old March 29th, 2001, 04:47 AM
Steve Schofield Steve Schofield is offline
Contributing User
ASP Free God 20th Plane (14500 - 14999 posts)
 
Join Date: Dec 2002
Posts: 14,575 Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level)Steve Schofield User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 22
<i><b>Originally posted by : Mage</b></i><br />By the way you need to use JavaScript here 'cause you can't work with clientside buttons and so on from the serverside ASP page!

Reply With Quote
Reply

Viewing: ASP Free ForumsProgramming.NET Development > timer in asp


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway