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

From: Date: Wed, 14 Nov 2007 01:34:30 +0000
Subject: Re: Quick questions -- how do I place the cursor (i.e., set focus) to a field on page load?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-264460@lists.php.net to get a copy of this message
i don't believe so. it should trigger the focus event for that element ID. of course you did download and include jquery.js in your page... can you send me (off list) the URL to the page? i can help you out, but it is off topic to PHP now :) On 11/13/07, Jon Westcot <jon@westcot.net> wrote: > 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 > >

« previous php.general (#264460) next »