0

Possible Duplicate:
Detecting idle time in JavaScript elegantly

I am working on a website and I want the cursor to be placed in a particular textbox if there is no activity from the user since last 20 seconds. Please help.

Community
  • 1
  • 1
Raj Gupta
  • 260
  • 3
  • 6
  • 18
  • This has nothing to do with PHP but needs to be done in Javascript - I re-tagged accordingly. – Pekka Oct 07 '11 at 14:04
  • How do you know if the user isn't just reading something or the page is opened in a back tab. There is no `onReadPage` event. – Jonathan Kuhn Oct 07 '11 at 14:06
  • What would you describe as "activity"? mousemove/click/keypress? – daiscog Oct 07 '11 at 14:07
  • Its a data entry application...there is only one text field and a submit button, so user can't be reading. He can only insert value in textfield and hit enter. I tried setInterval() function of javascript but that places the cursor in textbox every 20 seconds, doesnt matter user is active or not...Here no \activity means- no keypress. – Raj Gupta Oct 07 '11 at 14:20

0 Answers0