Re: Trying to set cfform focus in an Ajax window

2010-10-01 Thread John Pullam
Great, thanx for the explanation. I use firebug for CSS and errors but hadn't understood how the other tabs worked. When I click on the call and then open the response tab, here is what it shows (I can deduce what parts of it are there for but this is a bit beyond what I have done before):

Re: Trying to set cfform focus in an Ajax window

2010-10-01 Thread Michael Grant
No where in that code do you set focus to AccessID. On Fri, Oct 1, 2010 at 7:52 AM, John Pullam jpul...@mcleansystems.comwrote: Great, thanx for the explanation. I use firebug for CSS and errors but hadn't understood how the other tabs worked. When I click on the call and then open the

Re: Trying to set cfform focus in an Ajax window

2010-10-01 Thread John Pullam
That's not the code I wrote ... I set focus in the source. So does this look like another CF9 bug, that it doesn't call my function? My source code is above in this thread so I won't repeat it. ~| Order the Adobe Coldfusion

Re: Trying to set cfform focus in an Ajax window

2010-10-01 Thread Michael Grant
That IS the source. It's what the browser gets from ColdFusion. If you have code that exists in your cfm page that ISN'T being sent to your browser there MUST be a reason why. Is it possible you aren't actually outputting it to the browser? What happens if you wrap the js code I gave you before

Re: Trying to set cfform focus in an Ajax window

2010-10-01 Thread morgan l
Abbot and Costello. On Fri, Oct 1, 2010 at 9:10 AM, Michael Grant mgr...@modus.bz wrote: like this a Laurel and Hardy skit. Who's on first? Precisely! ~| Order the Adobe Coldfusion Anthology now!

Re: Trying to set cfform focus in an Ajax window

2010-10-01 Thread Michael Grant
Right! Thanks. On Fri, Oct 1, 2010 at 10:15 AM, morgan l greyk...@gmail.com wrote: Abbot and Costello. On Fri, Oct 1, 2010 at 9:10 AM, Michael Grant mgr...@modus.bz wrote: like this a Laurel and Hardy skit. Who's on first? Precisely!

Re: Trying to set cfform focus in an Ajax window

2010-10-01 Thread John Pullam
I too am trying not to get frustrated. I appreciate that you are trying to help and I suspect we are caught in semantics based on different technology experiences. In any event, I have learned more about what Firebug can do and the statement that should trigger the focus is in the code being

Re: Trying to set cfform focus in an Ajax window

2010-10-01 Thread Michael Grant
Tell you what John. Why don't you zip up the files and send them to me? On Fri, Oct 1, 2010 at 4:39 PM, John Pullam jpul...@mcleansystems.comwrote: I too am trying not to get frustrated. I appreciate that you are trying to help and I suspect we are caught in semantics based on different

Re: Trying to set cfform focus in an Ajax window

2010-09-30 Thread John Pullam
You may have to lead me into what exactly you'd like to see, but here is what I have coded and I'll be happy to view source and get you something else ... There are any number of pages that could force a login, and the do it from this sequence: a

Re: Trying to set cfform focus in an Ajax window

2010-09-30 Thread Michael Grant
That's the cf (pre-compiled) code. I want the source of what cf generates and sends to the browser. On Thu, Sep 30, 2010 at 7:59 AM, John Pullam jpul...@mcleansystems.comwrote: You may have to lead me into what exactly you'd like to see, but here is what I have coded and I'll be happy to

Re: Trying to set cfform focus in an Ajax window

2010-09-30 Thread John Pullam
Here is the view source from when the window has opened ... !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd; html headscript type=text/javascript/* ![CDATA[ */_cf_loadingtexthtml=img alt=' ' src='/CFIDE/scripts/ajax/resources/cf/images/loading.gif'/;

Re: Trying to set cfform focus in an Ajax window

2010-09-30 Thread Michael Grant
John, I'm looking for the compiled source of this page: ../MemberLogin.cfm On Thu, Sep 30, 2010 at 8:59 AM, John Pullam jpul...@mcleansystems.comwrote: Here is the view source from when the window has opened ... !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN

Re: Trying to set cfform focus in an Ajax window

2010-09-30 Thread John Pullam
Well I certainly understand that CF has to compile it before it runs it, but I have never concerned myself with that step. How would I see the compiled source? (Sorry to be so simple but it has never been an issue for me before.)

Re: Trying to set cfform focus in an Ajax window

2010-09-30 Thread Michael Grant
Ok, maybe I'm not explaining myself correctly. You know when you right click in your browser and then go view source to get the compiled source after cf has processed it? Well I want that source, but of your ajax result. So when you call the MemberLogin.cfm page I want the source code that's

RE: Trying to set cfform focus in an Ajax window

2010-09-30 Thread Andrew Scott
Grant [mailto:mgr...@modus.bz] Sent: Friday, 1 October 2010 9:15 AM To: cf-talk Subject: Re: Trying to set cfform focus in an Ajax window Ok, maybe I'm not explaining myself correctly. You know when you right click in your browser and then go view source to get the compiled source after cf

Re: Trying to set cfform focus in an Ajax window

2010-09-30 Thread Michael Grant
the response coming back from the server. Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Friday, 1 October 2010 9:15 AM To: cf-talk Subject: Re: Trying to set cfform focus in an Ajax window Ok, maybe

Re: Trying to set cfform focus in an Ajax window

2010-09-30 Thread John Pullam
Sorry but I certainly didn't understand what was involved to do that (hope my posts made that clear, but maybe not) and I don't have sufficient firebug skills to do what is suggested. Thanx for trying, but let's leave this problem as it lies. I'm obviously over my head and getting a cursor in

RE: Trying to set cfform focus in an Ajax window

2010-09-30 Thread Andrew Scott
] Sent: Friday, 1 October 2010 10:00 AM To: cf-talk Subject: Re: Trying to set cfform focus in an Ajax window Sorry but I certainly didn't understand what was involved to do that (hope my posts made that clear, but maybe not) and I don't have sufficient firebug skills to do what is suggested

RE: Trying to set cfform focus in an Ajax window

2010-09-30 Thread Andrew Scott
Sorry Michael I should have kept reading your post. Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Friday, 1 October 2010 9:45 AM To: cf-talk Subject: Re: Trying to set cfform focus in an Ajax window Sigh

Re: Trying to set cfform focus in an Ajax window

2010-09-30 Thread Michael Grant
October 2010 9:45 AM To: cf-talk Subject: Re: Trying to set cfform focus in an Ajax window Sigh. Yes, of course you can't. Which is why I said what I did. I gave an example of what compiled source was with the example of how you view a source. Then I went on to explain that I want

Re: Trying to set cfform focus in an Ajax window

2010-09-29 Thread morgan l
File this under slick code: it works! I just hope I remember this when the situation arises again. On Tue, Sep 28, 2010 at 7:25 AM, Michael Grant mgr...@modus.bz wrote: AjaxOnLoad cannot pass in any parameters to the function specified. Wondering out loud here and currently no way to

Re: Trying to set cfform focus in an Ajax window

2010-09-29 Thread Michael Grant
:D On Wed, Sep 29, 2010 at 10:13 AM, morgan l greyk...@gmail.com wrote: File this under slick code: it works! I just hope I remember this when the situation arises again. On Tue, Sep 28, 2010 at 7:25 AM, Michael Grant mgr...@modus.bz wrote: AjaxOnLoad cannot pass in any parameters

Re: Trying to set cfform focus in an Ajax window

2010-09-29 Thread John Pullam
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

Re: Trying to set cfform focus in an Ajax window

2010-09-29 Thread Michael Grant
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

Re: Trying to set cfform focus in an Ajax window

2010-09-28 Thread Michael Grant
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

Re: Trying to set cfform focus in an Ajax window

2010-09-28 Thread Michael Grant
AjaxOnLoad cannot pass in any parameters to the function specified. Wondering out loud here and currently no way to test, but couldn't you do this to pass parameters: cfset AjaxOnLoad('function(){init(someParam)}') / ~|

Re: Trying to set cfform focus in an Ajax window

2010-09-27 Thread John Pullam
I don't understand what you are trying to tell me. I don't currently use jquery so I can't really follow if you are doing something different. My case seems simple. I have inserted an alert (which fires) in the script so I am confident that the JavaScript code is being executed, but it simply

Re: Trying to set cfform focus in an Ajax window

2010-09-27 Thread Michael Grant
I'm trying to tell you that my earlier statement that I thought that inline javascript didn't fire when loaded via an ajax request was false. I did a test (using jquery as my ajax handler) and proved that I could set the focus to the AccessID field on page load. It seems there must be a problem

Re: Trying to set cfform focus in an Ajax window

2010-09-27 Thread John Pullam
No problem posting my code and providing a URL of it in action. The following is one of the many that I've tried which I believe to be syntactically correct. I left the JavaScript alert in so that you can see that it fires. First one of the calling pages: cfinclude

Re: Trying to set cfform focus in an Ajax window

2010-09-27 Thread Michael Grant
When I click on Members Only I get the following javascript error after I get the here alert box: Error processing JavaScript in markup for element Login_body: [Enable debugging by adding 'cfdebug' to your URL parameters to see more information] On Mon, Sep 27, 2010 at 2:45 PM, John Pullam

Re: Trying to set cfform focus in an Ajax window

2010-09-27 Thread John Pullam
Yes. That's what occurs when it tries to execute the line document.LoginForm.AccessID.focus(); That's what I'm trying to solve. ~| Order the Adobe Coldfusion Anthology now!

Re: Trying to set cfform focus in an Ajax window

2010-09-27 Thread Michael Grant
I don't know what to tell you. CF is obviously getting in your way in way or another when it comes to properly targeting your form. I think you're just going to have to troubleshoot the normal way. There's a few suggestions I can make. Perhaps add some alerts or console.log's to your code to see

Re: Trying to set cfform focus in an Ajax window

2010-09-27 Thread John Pullam
alert(document.LoginForm); gives the message undefined. I assume that means that at the time the JavaScript is executing there is no such object in the DOM. Could the JavaScript be executing at the wrong time? I'm wondering about using some sort of onAjaxLoad thing (but I have no experience

Re: Trying to set cfform focus in an Ajax window

2010-09-27 Thread morgan l
AjaxOnLoad is probably the way to go. Set up your .focus() line inside a function: init = function(){ document.LoginForm.AccessID.focus(); } and add : cfset AjaxOnLoad('init') to the page where you now have the document.LoginForm.AccessID.focus(); line . AjaxOnLoad cannot pass in any

Re: Trying to set cfform focus in an Ajax window

2010-09-26 Thread Michael Grant
Well you at least have your form and js set up right now. And after going back and re-reading your post I see this is ajax. IIRC in-line javascript in ajax content doesn't automatically fire. Most likely this is a security thing. So that gives you two options (at least). 1. Wrap your JS code at

RE: Trying to set cfform focus in an Ajax window

2010-09-26 Thread Andrew Scott
should still load and fire. I am almost 100% positive I have done that before. Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Sunday, 26 September 2010 11:23 PM To: cf-talk Subject: Re: Trying to set cfform focus

Re: Trying to set cfform focus in an Ajax window

2010-09-26 Thread Michael Grant
and fire. I am almost 100% positive I have done that before. Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Sunday, 26 September 2010 11:23 PM To: cf-talk Subject: Re: Trying to set cfform focus in an Ajax

Re: Trying to set cfform focus in an Ajax window

2010-09-25 Thread John Pullam
Well, it still doesn't work. I've been doing CF for several years myself and this one doesn't make a lot of sense. I have tried the various combos you are alluding to and the code now is: cfform name=LoginForm table id=LoginBox tr height=21 td width=100bAccess

Trying to set cfform focus in an Ajax window

2010-09-24 Thread John Pullam
I have a cfform inside an Ajax window and I am trying get the cursor to appear in the first input field when the window opens. I've tried the usual javascript solution but nothing seems to work for me. Any ideas? Extracted code from the module follows: div id=LoginDiv cfif LoginMsg

RE: Trying to set cfform focus in an Ajax window

2010-09-24 Thread Andrew Scott
Yes, when you want to reference something like document.LoginForm.AccessID.focus() you need to make sure that the ID of that element is set to AccessID, you have name set but not ID. Regards, Andrew Scott http://www.andyscott.id.au/

Re: Trying to set cfform focus in an Ajax window

2010-09-24 Thread Michael Grant
That's not true. The way he's referencing it is by the element name, not id. Otherwise it would be document.getElementById('AccessID').focus(); On Fri, Sep 24, 2010 at 8:54 AM, Andrew Scott andr...@andyscott.id.auwrote: Yes, when you want to reference something like

Re: Trying to set cfform focus in an Ajax window

2010-09-24 Thread Michael Grant
Two things. First the way you are referencing your form is by name, not ID. So you need to add this: name=LoginForm to your cfform tag.\ Also, i don't think that form has an onload function. Just put this at the bottom of your code: script document.LoginForm.AccessID.focus(); /script On

Re: Trying to set cfform focus in an Ajax window

2010-09-24 Thread Michael Grant
... Or add on document onload or document ready function. :) On Fri, Sep 24, 2010 at 9:06 AM, Michael Grant mgr...@modus.bz wrote: Two things. First the way you are referencing your form is by name, not ID. So you need to add this: name=LoginForm to your cfform tag.\ Also, i don't think

RE: Trying to set cfform focus in an Ajax window

2010-09-24 Thread Andrew Scott
CFForm does have an onLoad attribute. Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Friday, 24 September 2010 11:06 PM To: cf-talk Subject: Re: Trying to set cfform focus in an Ajax window Two things

Re: Trying to set cfform focus in an Ajax window

2010-09-24 Thread Michael Grant
Subject: Re: Trying to set cfform focus in an Ajax window Two things. First the way you are referencing your form is by name, not ID. So you need to add this: name=LoginForm to your cfform tag.\ Also, i don't think that form has an onload function. Just put this at the bottom of your code

RE: Trying to set cfform focus in an Ajax window

2010-09-24 Thread Andrew Scott
cfform focus in an Ajax window I said form, not cfform. Cf adds onload to the compiled form tag, which then proceeds to not work since form doesn't have an onload method. But don't take my word for it, try it yourself: cfform name=myForm onload=alert('my onload worked'); cfinput type=text

Re: Trying to set cfform focus in an Ajax window

2010-09-24 Thread Michael Grant
then yes you did, but I have to ask why you said form, when he is using cfform? Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Friday, 24 September 2010 11:34 PM To: cf-talk Subject: Re: Trying to set cfform

RE: Trying to set cfform focus in an Ajax window

2010-09-24 Thread Andrew Scott
To: cf-talk Subject: Re: Trying to set cfform focus in an Ajax window Because that's what cfform is. You don't actually think there's such a thing as a CFForm outside of CF do you? Or any CF tag for that matter? CF tags are compiled into HTML tags and sent to the browser

Re: Trying to set cfform focus in an Ajax window

2010-09-24 Thread Michael Grant
else. Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: Michael Grant [mailto:mgr...@modus.bz] Sent: Friday, 24 September 2010 11:40 PM To: cf-talk Subject: Re: Trying to set cfform focus in an Ajax window Because that's what cfform is. You