Focus an input box inside shadowbox

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Focus an input box inside shadowbox

m0w1337
Hi!

I'd like to know how it is possible to focus an Input box inside Shadowbox. With the usual onload="...focus()" in the body of the HTML that is loaded into shadowbox this isn't possible.

Would be very nice, if anybody could help me with this.

Thanks
m0
Reply | Threaded
Open this post in threaded view
|

Re: Focus an input box inside shadowbox

Ludwig
To Focus an input box you should using the setTimeout function !

For example after the form code :

--
<input type="text" id="email" />
<script type="text/javascript"> setTimeout("document.getElementById('email').focus()",0); </script>--

You can also put the timeout to 0, it works !

Ludwig.
Reply | Threaded
Open this post in threaded view
|

Re: Focus an input box inside shadowbox

Bobo
The above did not work for me.  I needed this:

function focusIt()
{
         window.setTimeout(doIt,100);

function doIt () {
document.getElementById("title").focus();
}
}
onload = focusIt;
Reply | Threaded
Open this post in threaded view
|

Re: Focus an input box inside shadowbox

Roman
Where exactly did you put that code?  I'm trying to set a focus on a text field inside a form that's displayed inside a shadowbox.  And it just won't do it no matter where I try to put it.