Re: timer in front page

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Kevin Spencer (kspencer_at_takempis.com)
Date: 07/20/04


Date: Tue, 20 Jul 2004 16:57:56 -0400

Well, it's got to be a little more complicated than that. For example, while
you could certainly add a timing element to a web page, telling the user
that their time is up isn't going to prevent them from continuing with the
test. One solution would be to use JavaScript to submit the form when the
time runs out, so that the user could not continue. This could be done by
defining a JavaScript function to submit the form, and using another script
to set the time that the first function would be delayed from running.
Example:

<script type="text/javascript"><!--
function submitForm()
{
    document.forms[0].submit();
}
setTimeout("submitForm()", 30000);

// --></script>

The JavaScript setTimeout() function takes 2 parameters. The first is the
name of the function to execute. The second is the number of milliseconds to
wait before executing. In my example, it would execute in 30 minutes.

-- 
HTH,
Kevin Spencer
.Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
"mo" <anonymous@discussions.microsoft.com> wrote in message
news:0d5901c46e97$d11025f0$a501280a@phx.gbl...
> Im trying to design a multiple choice test within the
> WebPage with a timer. The timer could be started with a
> mouse click so that the user would know when the time
> runs out.  they cannot work on the test anymore. How do
> you put a timer into the WebPage?
>
> please help


Relevant Pages

  • Re: More bollocks from biggots
    ... So if you choose to visit sites that execute JavaScript from "Who knows ... Google as the Google Mail HTML/Javascript does. ... javascript response stored in memory. ...
    (comp.os.vms)
  • Re: Back to Threads
    ... Yeah you would think it would be easier I know. ... Keep in mind that so-called 'asynchronous delegates' may be asynchronous, ... but they simply execute on a temporary worker thread taken from the thread ... > a Timer from the System.Timers namespace as opposed to the Windows.Forms ...
    (microsoft.public.dotnet.languages.csharp)
  • Execute JavaScript in a Web Browser Control using VB6
    ... Browser Control? ... exposed by a JavaApplet using JavaScript. ... My question was how do I execute this line of code in VB6 using the ... implement JavaScript wrapper functions just for me and since this code ...
    (microsoft.public.vb.general.discussion)
  • Re: Back to Threads
    ... Any timers added in the UI (through the Timer control) require that the ... message queue is being pumped in the UI thread for the timer to execute. ... "Michael C" wrote in message ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: timer functionality.......need ur help
    ... There is a setTimeout function in javascript that is sort of like a one-time ... then the player marks that numbers in his tciket as completed. ... I've used a timer control to display the numbers after every 10 ...
    (microsoft.public.dotnet.framework)