Forum Moderators: coopster & phranque

Message Too Old, No Replies

cursor and form fields

a question.....?

         

dreamcatcher

10:16 pm on Apr 20, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When I go to a site like google, I notice they have the cursor automatically flashing in the search text box, so you can just type in what you want straight away, without having to click in the text box and then type something.

How do they do that?

:)

mavherick

10:27 pm on Apr 20, 2003 (gmt 0)

10+ Year Member



Simply setting the focus to the search box in the onLoad attribute of the body. Just check the source at Google for how they do it.

Note: it's accomplished with JavaScript

dreamcatcher

10:45 am on Apr 21, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks, as soon as you mentioned javascript I just did a search. The following works fine.

OnLoad="document.loginform.user.focus();"

Thank you for the help!