By callback I mean the function that you've defined for execution when the ajax call receives a successful response.
If the focus is being set, then "un-set" I suspect that CF is adding some extra js code that's messing things up. I personally don't ever use CF's brand of ajax functionality (of cfform for that matter) so I can't say for sure why it would be happening. I generally either write my own and lately have started using JQuery a lot more. (Anyone who knows me knows that this is a big step for me to use something pre-written, but that's a different story.) Any chance you can post the output of the ajax call? By that I mean the form stuff that the ajax call adds to the page on successful execution. On Wed, Sep 29, 2010 at 5:17 PM, John Pullam <[email protected]>wrote: > > >It might be that the form hasn't been added to the dom, though that's > >usually not the case since the js comes after the form code. > >However if you'll remember a few days ago I suggested: > > > >> 1. Wrap your JS code at the bottom of the page in a function and execute > >the function when the ajax call completes. > >> 2. Add your focus setting code into a callback function on the ajax > call. > > > >That advice is still sound. > > > > > > > >On Mon, Sep 27, 2010 at 4:56 PM, John Pullam <[email protected] > >wrote: > > > >> > > Must admit that I'm not really sure what you are suggesting. e.g., what do > you mean a callback function on the ajax call? > > In any event, it all seems fairly consistent at the moment. I have > converted to using AjaxOnLoad and the function contains either: > > document.LoginForm.AccessID.focus(); or > document.getElementById("AccessID").focus(); > > Regardless of which I use, it works fine in Opera, Chrome and Safari. > Neither work in IE, and in Firefox, the cursor is set but it moves away > again in about a second. > > Very strange but it is not worth the amount of time being spent so I will > probably give up on ever fixing it and assume it is some kind of CF9 issue > that will get resolved over time. > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Order the Adobe Coldfusion Anthology now! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337672 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

