Re: Quick questions -- how do I place the cursor (i.e., set focus) to a field on page load?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mike:

> you want javascript.
>
> i'd recommend using jquery (jquery.com)

    I'll look into this.  Thanks.

> put an id="username" on the username box.
>
> then do
>
> <script type="text/javascript">
> $(document).ready(function() {
>    $("#username").focus();
> });
> </script>
>
> voila

    Hmmm.  It didn't work for me.  Do I need to change any of the code you
provided or should it work as you wrote it?

    Thanks, though, for the code snippet.  I'll look up its pieces to see if
I can figure out what isn't working for me.

    Jon

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux