How to set the focus on a hidden textbox field using JavaScript?

If you really need to do this, make the box transparent, not hidden:

opacity:0;
filter:alpha(opacity=0);

Alternatively, if you want to ensure that the user doesn’t accidentally click it, just place the input inside a div with

width: 0;
overflow: hidden;

However, there is most certainly a better way to do what you want, maybe using keydown/keypress events.

Leave a Comment

404 Not Found

Not Found

The requested URL was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.