Could you suggest the best way to keep focus on a particular input field on page?
What I am trying to say is, no matter where user clicks on the screen, the focus should return back to this one particular input.
I am thinking of a timer function that would check for focus every 500ms and if its not there, then bring it back.
Also the best way to submit this input field without making use of any button
Any other and best solution for this?
Could you suggest the best way to keep focus on a particular input field
Share
Even if I don’t like the idea, thinking about usability and user experience. Anyway, to answer your question, your best shot probably is to set the focus initially to that input element and watch for the
blurevent. Addionally you might want to check foroutsideclick events.That might look like this:
That would force the focus to that input (with the
ID“test”) 25ms after it lost the focus. To check for the additional outside-click check this link.Example link: http://www.jsfiddle.net/FX79h/
Again, this sounds not usefriendly. You might want to think about whatever you are trying to do.