Re: timestamp at start of filling out form and form completion

On Nov 24, 4:06 pm, "Peter H. Coffin" <hell...@xxxxxxxxxxxxx> wrote:
On Tue, 24 Nov 2009 04:52:27 -0800 (PST), Skygal wrote:
I'd like to be able to determine how long a user took to fill out a
form. I'm assuming it would be by getting a timestamp at beginning of
the form and again when user clicks on submit. Has anyone ever done

When sendingthe form, include a hidden field that contains the current
timestamp. If your form page is generated by php, this becomes trivially

Science is like sex:
 sometimes something useful comes out, but that's not why we're doing it.
              -- Richard Feynman

The only caveat with this approach is that you'll be able to measure
the interval between the form being generated and the submit arriving
back at the server - if you want to exclude the network time at either
end then you'd need to capture the arrival time using javascript, then
work out the delay in the forms onsubmit method and populate this into
a field on the form before the onsubmit method returns.

How/where you capture the arrival time will have a significant impact
on what it is you actually measure - using inline javascript should
trigger the capture some time between the code arriving at the browser
and the html file loading completely (unless it calls some javascript
from a seperate file). OTOH, the page.onload method only fires after
all the content explicitly referenced in the HTML file has loaded.

Note that you can't mix and match server and client filestamps - only
calculate intervals using like-for-like.