Focus element in ThickBox March 24, 2009
I faced with a problem focusing element in thickbox popup. I open login form using thickbox and want to take a focus on the first element of the form. Though the following code does look to be working:
$(document).ready(function() {
$("input[name='username']").focus();
});
$("input[name='username']").focus();
});
But there is a little trick. If you make a small 100ms delay in focus() call it works:
$(document).ready(function() {
setTimeout("$(\"input[name='username']\").focus();", 100);
});
setTimeout("$(\"input[name='username']\").focus();", 100);
});
My name is Alexander Kleshchevnikov. I have been working as a professinal web application developer since 2002. I believe in simple intelligence from server technologies to front-end development. Now I run my own web development consulting company in Ukraine. You can find 
thanks!
Thank you!!!! I was getting really upset because I couldn’t focus a simple textbox, but I thought… “could it be thickbox?” and I found your answer later, thank you! :)
Thank you. This solved a big problem!
thank you. your method is working.
thanks, I’M FROM BRAZIL AND your method is working.