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

2007-11-13 Thread Casey
1) window.onload = function () {formfield.focus();} 2) Meta refresh or some combination of Javascript, flush(), and ob_flush(). On Nov 13, 2007, at 3:46 PM, "Jon Westcot" <[EMAIL PROTECTED]> wrote: Hi all: This may or may not be a PHP-related question, but, since I'm coding with PHP,

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

2007-11-13 Thread tedd
At 6:52 PM -0700 11/13/07, Jon Westcot wrote: > Here's a collection of animated wait gifs: http://webbytedd.com/bb/wait/ Steal as you need -- I did. Thanks. I'll check that out. I'm still wondering, though, how the redirection works if it is supposed to occur only before any text ap

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

2007-11-13 Thread mike
in my experience it never stops at a single focus event on a login box... but yes, i should have replied with the simpler solution first. On 11/13/07, tedd <[EMAIL PROTECTED]> wrote: > At 5:49 PM -0800 11/13/07, mike wrote: > >yeah, but adding in jquery will open up his entire world :) > > It cou

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

2007-11-13 Thread tedd
At 5:49 PM -0800 11/13/07, mike wrote: yeah, but adding in jquery will open up his entire world :) It could, but it's an overkill for a simple input field focus thing, IMO. It's like selling a guy a Hummer because he wants to drive on the gravel on the side of the road. Cheers, tedd -- ---

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

2007-11-13 Thread Jon Westcot
Hi Tedd: > > Also, while I'm asking questions, let me ask another one: I've > >seen several pages (frequently, pages that come up after a login > >page has been filled out) that provide some user mollification (you > >know, the typical "Please be patient, don't get your nylons in a > >knot, we

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

2007-11-13 Thread Jon Westcot
Hi Mike, Chris, et al.: Thanks for the info. I'm not certain if I'll be needing jquery, or what benefits it might afford me with my meager little project, but I will check it out. In the meantime, Chris's snippet worked like a charm! Thanks! Jon -- PHP General Mailing List (http:

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

2007-11-13 Thread mike
yeah, but adding in jquery will open up his entire world :) the example below will work without jquery. personally though i try to stick with jquery since i usually need it for more throughout my site. On 11/13/07, Chris <[EMAIL PROTECTED]> wrote: > It only works if you have included the jquery

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

2007-11-13 Thread Chris
Jon Westcot 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 $(document).ready(function() { $("#username").focus(); }); voila Hmmm. It didn't work for me. Do I ne

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

2007-11-13 Thread tedd
At 4:46 PM -0700 11/13/07, Jon Westcot wrote: Hi all: This may or may not be a PHP-related question, but, since I'm coding with PHP, I thought I'd ask: When a form loads, such as a login form, I'd like to have the cursor placed automatically in the Username field. Right now, it req

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

2007-11-13 Thread mike
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 <[EMAIL PROTECTED]> wrote: > H

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

2007-11-13 Thread Jon Westcot
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 > > > $(document).ready(function() { >$("#username").focus(); > }); > > > voila Hmmm. It didn't work for me. Do I nee

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

2007-11-13 Thread mike
you want javascript. i'd recommend using jquery (jquery.com) put an id="username" on the username box. then do $(document).ready(function() { $("#username").focus(); }); voila On 11/13/07, Jon Westcot <[EMAIL PROTECTED]> wrote: > Hi all: > >This may or may not be a PHP-related questi

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

2007-11-13 Thread Jon Westcot
Hi all: This may or may not be a PHP-related question, but, since I'm coding with PHP, I thought I'd ask: When a form loads, such as a login form, I'd like to have the cursor placed automatically in the Username field. Right now, it requires me to click it with the mouse or to tab int