Forums

Time a user when he starts filling a form - is it possible?

quantum_leap 19 Oct, 2011
I need to time how long it takes a user to fill in a form. Basically, I would like a message to be displayed after a certain time has elapsed while a user is filling in the form, telling the user to start again. Is that possible?
GreyHead 19 Oct, 2011
Hi quantum_leap,

How do you define 'starts filling'? I guess that you could start a JavaScript timer running on page load, or first click.

Bob
quantum_leap 19 Oct, 2011
Yeah, I mean starts filling when user clicks on the first field, I guess. Should I google for a javascript timer script, then? I am sorry I'm not a hardcore developer just a designer using Joomla. How could I import such a script and return some values so that a notification can be displayed on the page where the form resides?
GreyHead 20 Oct, 2011
Hi quantum_leap,

I found a MooTools timer at Google Groups here. That requires a sing in so I'll copy the post below.

Bob

Timer Class for Mootools

Kevin Hunter
Apr 21 2009, 10:14 pm

I've written a small class to display a timer on the page. It's not
complete, and could be added to, but here goes.

I release it under the GPLv3 license.

http://cs.earlham.edu/~kevin/Mootools.Timer.js

Of note:

- It's a timer. You create it with:

var timer = new Timer();
$('clock').timer = new Timer({length: 5000});  // length is in
milliseconds


- It's updates itself on the page:
...
<p id='clock'></p>
...
var timer = new Timer({length: 10000});
timer.setDisplay( $('clock') );
  ... or ...
var timer = new Timer({length: 10000, display: $('clock')});


Putting the two together:
var clock = $('clock');
clock.timer = new Timer({length: 10000, display: clock});


- It's a timer, not clock, so start it:
clock.startTimer(); // will update itself thanks to display:


Other options:
granularity - how often to update a display, defaults to 250ms.
callback - a function to call when timer hits zero.

Currently, it can display up to tenths, but I haven't finished working
that in. I may not either as the project didn't call for it. If
someone else wants to take up the flag ...

This topic is locked and no more replies can be posted.