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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)