Click to See Complete Forum and Search --> : Focus() in two different fields


benone
08-14-2004, 10:21 AM
Can anyone help with a Focus() problem.
I have this little chat thing on my website, the messages are in an inline frame, and then the textarea to add messages is on the regular page right beneath it. When the page loads, I want it to focus() in a form at the bottom of the inline frame, to bring the scroll bar down on the side so that the newest messages can be read, but afterwards I want the focus() to move out of the inline frame and to the textarea so that the user can start typing a message, without having to click inside the textarea everytime the page is refreshed just to move the cursor inside to type.

I dont know if its possible for the focus() to move to different fields while the page is loading, but if anyone could help, I would appreciate it thanks.

Exuro
08-14-2004, 12:51 PM
Why don't you just put an anchor at the bottom of your iframe and jump to it by adding an #id at the end of the src attribute of your iframe? Then you can just set the focus of the main frame to the textbox and you should be set!

Kor
08-16-2004, 03:13 AM
...but afterwards I want the focus()...


afterwards when? After a number of seconds? When user do an action (click a button? focus something? press a key?...)? If so, which action?