How do I force cursor to always be in one form field using HTML5/Javascript?

Viewed 1236

I am trying to keep the focus always on one form field. It basically needs to always be active on the page so if anything is typed it is always into this field. How do I accomplish this? I have used the autofocus command from HTML5 but once I switch it does not go back without page refresh. Basically I want the cursor to be forced to always stay in that form field?

<input type="text" placeholder="Type Here" id="forced" required autofocus> 

This all must be controlled on the client end so only HTML5 and Javascript can be used. Is there a solution for this?

4 Answers
Related