I have a login box that pops up when you click on the login button, and that lightbox will have a login form loaded into it.
I have tried setting
onLoad=”document.loginForm.login.focus()” to try and set the focus on the login box when the page loads.
However, this seems to only work, after you refresh the login form in the lightbox, not the parent documents behind it.
I have tried adding a timeout option to the function as I thought it may be a timing issue, but this does not seem to have worked.
Does anyone have any ideas why it works after a refresh, but not on first load?
Thanks
Eds
I think this should help you:
If you have more than one iframe in your page, then give an id to your target iframe and use
$("#myIframeId")instead of$("iframe")