Re: Trying to set cfform focus in an Ajax window
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): script type=text/javascript/* ![CDATA[ */ ColdFusion.Ajax.checkImportedTag('CFFORM'); /* ]] *//script script type=text/javascript/* ![CDATA[ */ if (window.ColdFusion) ColdFusion.required['AccessID']=true; /* ]] *//script script type=text/javascript/* ![CDATA[ */ if (window.ColdFusion) ColdFusion.required['Password']=true; /* ]] *//script script type=text/javascript/* ![CDATA[ */ ColdFusion.Ajax.checkImportedTag('CFFORM'); /* ]] *//script script type=text/javascript !-- _CF_checkLoginForm = function(_CF_this) { //reset on submit _CF_error_exists = false; _CF_error_messages = new Array(); _CF_error_fields = new Object(); _CF_FirstErrorField = null; //form element AccessID required check if( _CF_hasValue(_CF_this['AccessID'], TEXT, false ) ) { //form element AccessID 'RANGE' validation checks if (!_CF_checkrange(_CF_this['AccessID'].value, 1000.0,4999.0, true)) { _CF_onError(_CF_this, AccessID, _CF_this['AccessID'].value, A valid Access ID is required); _CF_error_exists = true; } }else { _CF_onError(_CF_this, AccessID, _CF_this['AccessID'].value, A valid Access ID is required); _CF_error_exists = true; } //form element Password required check if( !_CF_hasValue(_CF_this['Password'], PASSWORD, false ) ) { _CF_onError(_CF_this, Password, _CF_this['Password'].value, A password is required); _CF_error_exists = true; } //display error messages and return success if( _CF_error_exists ) { if( _CF_error_messages.length 0 ) { // show alert() message _CF_onErrorAlert(_CF_error_messages); // set focus to first form error, if the field supports js focus(). if( _CF_this[_CF_FirstErrorField].type == text ) { _CF_this[_CF_FirstErrorField].focus(); } } return false; }else { return true; } } //-- /script script type=text/javascript/* ![CDATA[ */ ColdFusion.Event.registerOnLoad(LoginInit,{_cf_containerId:'Login_body'},false,true); /* ]] *//script div id=LoginDiv pPlease identify yourself, then press quot;Submitquot;/p form name=LoginForm id=LoginForm action=/WGC-CF/MemberLogin.cfm?_cf_containerId=Login_body_cf_nodebug=true_cf_nocache=true_cf_clientid=843C53D8689D544653CE2DD24EE6081A_cf_rc=1 method=post onsubmit=return ColdFusion.Ajax.checkForm(this, _CF_checkLoginForm,'Login_body') table id=LoginBox tr height=21 td width=100bAccess ID/b/td td width=100input name=AccessID type=text id=AccessID size=8 //td /tr tr height=21 tdbPassword/b/td tdinput name=Password id=Password type=password size=8 //td /tr tr height=21 td colspan=2span class=fineprintRemember me on this computer/span input type=checkbox name=Remember value=Yes /td /tr /table input name=Submit id=Submit type=image value=Submit src=../Buttons/MSubmit.png / /form /div ~| 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:337728 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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 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): script type=text/javascript/* ![CDATA[ */ ColdFusion.Ajax.checkImportedTag('CFFORM'); /* ]] *//script script type=text/javascript/* ![CDATA[ */ if (window.ColdFusion) ColdFusion.required['AccessID']=true; /* ]] *//script script type=text/javascript/* ![CDATA[ */ if (window.ColdFusion) ColdFusion.required['Password']=true; /* ]] *//script script type=text/javascript/* ![CDATA[ */ ColdFusion.Ajax.checkImportedTag('CFFORM'); /* ]] *//script script type=text/javascript !-- _CF_checkLoginForm = function(_CF_this) { //reset on submit _CF_error_exists = false; _CF_error_messages = new Array(); _CF_error_fields = new Object(); _CF_FirstErrorField = null; //form element AccessID required check if( _CF_hasValue(_CF_this['AccessID'], TEXT, false ) ) { //form element AccessID 'RANGE' validation checks if (!_CF_checkrange(_CF_this['AccessID'].value, 1000.0,4999.0, true)) { _CF_onError(_CF_this, AccessID, _CF_this['AccessID'].value, A valid Access ID is required); _CF_error_exists = true; } }else { _CF_onError(_CF_this, AccessID, _CF_this['AccessID'].value, A valid Access ID is required); _CF_error_exists = true; } //form element Password required check if( !_CF_hasValue(_CF_this['Password'], PASSWORD, false ) ) { _CF_onError(_CF_this, Password, _CF_this['Password'].value, A password is required); _CF_error_exists = true; } //display error messages and return success if( _CF_error_exists ) { if( _CF_error_messages.length 0 ) { // show alert() message _CF_onErrorAlert(_CF_error_messages); // set focus to first form error, if the field supports js focus(). if( _CF_this[_CF_FirstErrorField].type == text ) { _CF_this[_CF_FirstErrorField].focus(); } } return false; }else { return true; } } //-- /script script type=text/javascript/* ![CDATA[ */ ColdFusion.Event.registerOnLoad(LoginInit,{_cf_containerId:'Login_body'},false,true); /* ]] *//script div id=LoginDiv pPlease identify yourself, then press quot;Submitquot;/p form name=LoginForm id=LoginForm action=/WGC-CF/MemberLogin.cfm?_cf_containerId=Login_body_cf_nodebug=true_cf_nocache=true_cf_clientid=843C53D8689D544653CE2DD24EE6081A_cf_rc=1 method=post onsubmit=return ColdFusion.Ajax.checkForm(this, _CF_checkLoginForm,'Login_body') table id=LoginBox tr height=21 td width=100bAccess ID/b/td td width=100input name=AccessID type=text id=AccessID size=8 //td /tr tr height=21 tdbPassword/b/td tdinput name=Password id=Password type=password size=8 //td /tr tr height=21 td colspan=2span class=fineprintRemember me on this computer/span input type=checkbox name=Remember value=Yes /td /tr /table input name=Submit id=Submit type=image value=Submit src=../Buttons/MSubmit.png / /form /div ~| 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:337729 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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 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:337731 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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 in cfoutput tags? I'm really trying to not get frustrated but I'm starting to feel a little like this a Laurel and Hardy skit. Who's on first? Precisely! ~| 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:337732 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337733 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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! ~| 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:337734 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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 sent to the browser. At present it's inside the AjaxOnLoad function and the JavaScript statement just before the HTML (calling LoginInit)should be triggering it: script type=text/javascript/* ![CDATA[ */ ColdFusion.Event.registerOnLoad(LoginInit,{_cf_containerId:'Login_body'},false,true); /* ]] *//script I know this works because I also have put an alert in there and the alert fires (and have removed it as well). When I go to the original (which I believe is what you would like to see there, I replace the AjaxOnLoad with: script document.LoginForm.AccessID.focus(); /script It also shows up in the code sent to the browser but generates the run time error: document.LoginForm is undefined ~| 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:337762 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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 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 sent to the browser. At present it's inside the AjaxOnLoad function and the JavaScript statement just before the HTML (calling LoginInit)should be triggering it: script type=text/javascript/* ![CDATA[ */ ColdFusion.Event.registerOnLoad(LoginInit,{_cf_containerId:'Login_body'},false,true); /* ]] *//script I know this works because I also have put an alert in there and the alert fires (and have removed it as well). When I go to the original (which I believe is what you would like to see there, I replace the AjaxOnLoad with: script document.LoginForm.AccessID.focus(); /script It also shows up in the code sent to the browser but generates the run time error: document.LoginForm is undefined ~| 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:337764 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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 href=javascript:ColdFusion.Window.show('Login');ColdFusion.navigate('../MemberLogin.cfm','Login'); bMembers Only/b/a The login processor does some server stuff and then shows the form: div id=LoginDiv cfif LoginMsg pPlease identify yourself, then press quot;Submitquot;/p cfelse p class=errormsgIncorrect Access ID or Password. Please try again./p/cfif cfoutput cfform name=LoginForm table id=LoginBox tr height=21 td width=100bAccess ID/b/td td width=100cfinput name=AccessID validate=range range=1000,4999 value=#DefAccessID# size=8 ID=AccessID required=yes message=A valid Access ID is required //td /tr tr height=21 tdbPassword/b/td tdcfinput name=Password type=password value=#DefPassword# size=8 required=Yes message=A password is required //td /tr tr height=21 td colspan=2span class=fineprintRemember me on this computer/span cfset checked=IIf(DefRemember EQ Yes,'checked','') input type=checkbox name=Remember value=Yes #checked#/td /tr /table cfinput name=Submit type=image value=Submit src=../Buttons/MSubmit.png / /cfform /cfoutput/div cfset AjaxOnLoad('LoginInit') /cfif The LoginInit function is: function LoginInit() { document.LoginForm.AccessID.focus(); // document.getElementById(AccessID).focus(); } What else can I show you? ~| 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:337681 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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 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 href=javascript:ColdFusion.Window.show('Login');ColdFusion.navigate('../MemberLogin.cfm','Login'); bMembers Only/b/a The login processor does some server stuff and then shows the form: div id=LoginDiv cfif LoginMsg pPlease identify yourself, then press quot;Submitquot;/p cfelse p class=errormsgIncorrect Access ID or Password. Please try again./p/cfif cfoutput cfform name=LoginForm table id=LoginBox tr height=21 td width=100bAccess ID/b/td td width=100cfinput name=AccessID validate=range range=1000,4999 value=#DefAccessID# size=8 ID=AccessID required=yes message=A valid Access ID is required //td /tr tr height=21 tdbPassword/b/td tdcfinput name=Password type=password value=#DefPassword# size=8 required=Yes message=A password is required //td /tr tr height=21 td colspan=2span class=fineprintRemember me on this computer/span cfset checked=IIf(DefRemember EQ Yes,'checked','') input type=checkbox name=Remember value=Yes #checked#/td /tr /table cfinput name=Submit type=image value=Submit src=../Buttons/MSubmit.png / /cfform /cfoutput/div cfset AjaxOnLoad('LoginInit') /cfif The LoginInit function is: function LoginInit() { document.LoginForm.AccessID.focus(); // document.getElementById(AccessID).focus(); } What else can I show you? ~| 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:337682 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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'/; _cf_contextpath=; _cf_ajaxscriptsrc=/CFIDE/scripts/ajax; _cf_jsonprefix='//'; _cf_clientid='843C53D8689D544653CE2DD24EE6081A';/* ]] *//scriptscript type=text/javascript src=/CFIDE/scripts/ajax/yui/yahoo-dom-event/yahoo-dom-event.js/script script type=text/javascript src=/CFIDE/scripts/ajax/messages/cfmessage.js/script script type=text/javascript src=/CFIDE/scripts/ajax/package/cfajax.js/script script type=text/javascript src=/CFIDE/scripts/ajax/yui/animation/animation-min.js/script script type=text/javascript src=/CFIDE/scripts/ajax/ext/adapter/yui/ext-yui-adapter.js/script script type=text/javascript src=/CFIDE/scripts/ajax/ext/ext-all.js/script script type=text/javascript src=/CFIDE/scripts/ajax/package/cfwindow.js/script script type=text/javascript src=/CFIDE/scripts/cfform.js/script script type=text/javascript src=/CFIDE/scripts/masks.js/script script type=text/javascript src=/CFIDE/scripts/cfformhistory.js/script link rel=stylesheet type=text/css href=/CFIDE/scripts/ajax/resources/ext/css/ext-all.css / link rel=stylesheet type=text/css href=/CFIDE/scripts/ajax/resources/cf/cf.css / meta http-equiv=Content-Type content=text/html; charset=utf-8 titleWhitevale Golf Club/title link rel=stylesheet media=all type=text/css href=../WGCStyle10.css / script language=JavaScript src=../WGCCF.js/script script type=text/javascript function ChangeWidth() { var winW = 630; if (parseInt(navigator.appVersion)3) { if (navigator.appName==Netscape || navigator.appName==Opera) { winW = window.innerWidth; } if (navigator.appName.indexOf(Microsoft)!=-1) { winW = document.body.offsetWidth; } } document.images[image0].width = winW; } /script script type=text/javascript/* ![CDATA[ */ ColdFusion.Ajax.importTag('CFWINDOW'); /* ]] *//script script type=text/javascript/* ![CDATA[ */ ColdFusion.Ajax.importTag('CFAJAXPROXY'); /* ]] *//script script type=text/javascript/* ![CDATA[ */ ColdFusion.Ajax.importTag('CFFORM'); /* ]] *//script script type=text/javascript/* ![CDATA[ */ var _cf_window_init_1285851829390=function() { var _cf_window=ColdFusion.Window.create('Login','Please login','',{ modal:true, closable:true, divid:'cf_window1285851829389', draggable:true, resizable:false, fixedcenter:false, width:380, height:200, shadow:true, bodystyle:'font-size:12px; font-family: verdana; background-color: #dcefd2; color: black; text-align: left;', headerstyle:'font-size:13px; font-weight:bold; font-family:Verdana; background-color: #2e5327; color: white; text-align:left;', callfromtag:true, initshow:false, destroyonclose:false, x:80, y:80}); };ColdFusion.Event.registerOnLoad(_cf_window_init_1285851829390); /* ]] *//script /head body OnLoad=ChangeWidth() id=SplashBody img id=image0 src=SplashHole4.jpg div id=SplashLogoa href=PublicHome.cfmimg SRC=SplashLogo.png border=0/a/div div id=SplashButtons a href=PublicHome.cfmimg SRC=../Buttons/LGuests.png hspace=25 border=0/a a href=javascript:ColdFusion.Window.show('Login');ColdFusion.navigate('../MemberLogin.cfm','Login'); img SRC=../Buttons/LMembers.png hspace=25 border=0/a/div div id=cf_window1285851829389 class=x-hidden div id=Login_title class=x-window-header style=font-size:13px; font-weight:bold; font-family:Verdana; background-color: #2e5327; color: white; text-align:left; Please login /div div id=Login_body class=x-window-body style=font-size:12px; font-family: verdana; background-color: #dcefd2; color: black; text-align: left; /div /div /body /html If you'd like to see something else, how do I get it? ~| 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:337683 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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 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'/; _cf_contextpath=; _cf_ajaxscriptsrc=/CFIDE/scripts/ajax; _cf_jsonprefix='//'; _cf_clientid='843C53D8689D544653CE2DD24EE6081A';/* ]] *//scriptscript type=text/javascript src=/CFIDE/scripts/ajax/yui/yahoo-dom-event/yahoo-dom-event.js/script script type=text/javascript src=/CFIDE/scripts/ajax/messages/cfmessage.js/script script type=text/javascript src=/CFIDE/scripts/ajax/package/cfajax.js/script script type=text/javascript src=/CFIDE/scripts/ajax/yui/animation/animation-min.js/script script type=text/javascript src=/CFIDE/scripts/ajax/ext/adapter/yui/ext-yui-adapter.js/script script type=text/javascript src=/CFIDE/scripts/ajax/ext/ext-all.js/script script type=text/javascript src=/CFIDE/scripts/ajax/package/cfwindow.js/script script type=text/javascript src=/CFIDE/scripts/cfform.js/script script type=text/javascript src=/CFIDE/scripts/masks.js/script script type=text/javascript src=/CFIDE/scripts/cfformhistory.js/script link rel=stylesheet type=text/css href=/CFIDE/scripts/ajax/resources/ext/css/ext-all.css / link rel=stylesheet type=text/css href=/CFIDE/scripts/ajax/resources/cf/cf.css / meta http-equiv=Content-Type content=text/html; charset=utf-8 titleWhitevale Golf Club/title link rel=stylesheet media=all type=text/css href=../WGCStyle10.css / script language=JavaScript src=../WGCCF.js/script script type=text/javascript function ChangeWidth() { var winW = 630; if (parseInt(navigator.appVersion)3) { if (navigator.appName==Netscape || navigator.appName==Opera) { winW = window.innerWidth; } if (navigator.appName.indexOf(Microsoft)!=-1) { winW = document.body.offsetWidth; } } document.images[image0].width = winW; } /script script type=text/javascript/* ![CDATA[ */ ColdFusion.Ajax.importTag('CFWINDOW'); /* ]] *//script script type=text/javascript/* ![CDATA[ */ ColdFusion.Ajax.importTag('CFAJAXPROXY'); /* ]] *//script script type=text/javascript/* ![CDATA[ */ ColdFusion.Ajax.importTag('CFFORM'); /* ]] *//script script type=text/javascript/* ![CDATA[ */ var _cf_window_init_1285851829390=function() { var _cf_window=ColdFusion.Window.create('Login','Please login','',{ modal:true, closable:true, divid:'cf_window1285851829389', draggable:true, resizable:false, fixedcenter:false, width:380, height:200, shadow:true, bodystyle:'font-size:12px; font-family: verdana; background-color: #dcefd2; color: black; text-align: left;', headerstyle:'font-size:13px; font-weight:bold; font-family:Verdana; background-color: #2e5327; color: white; text-align:left;', callfromtag:true, initshow:false, destroyonclose:false, x:80, y:80}); };ColdFusion.Event.registerOnLoad(_cf_window_init_1285851829390); /* ]] *//script /head body OnLoad=ChangeWidth() id=SplashBody img id=image0 src=SplashHole4.jpg div id=SplashLogoa href=PublicHome.cfmimg SRC=SplashLogo.png border=0/a/div div id=SplashButtons a href=PublicHome.cfmimg SRC=../Buttons/LGuests.png hspace=25 border=0/a a href=javascript:ColdFusion.Window.show('Login');ColdFusion.navigate('../MemberLogin.cfm','Login'); img SRC=../Buttons/LMembers.png hspace=25 border=0/a/div div id=cf_window1285851829389 class=x-hidden div id=Login_title class=x-window-header style=font-size:13px; font-weight:bold; font-family:Verdana; background-color: #2e5327; color: white; text-align:left; Please login /div div id=Login_body class=x-window-body style=font-size:12px; font-family: verdana; background-color: #dcefd2; color: black; text-align: left; /div /div /body /html If you'd like to see something else, how do I get it? ~| 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:337684 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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.) ~| 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:337715 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
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 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 returned. How you get it is up to you. Dump out the result, send it to you in an email, add it to a textarea, call the page directly or a dozen other ways. On Thu, Sep 30, 2010 at 4:46 PM, John Pullam jpul...@mcleansystems.comwrote: 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.) ~| 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:337717 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Trying to set cfform focus in an Ajax window
Michael, injected code via Ajax will not appear in a view source. The best way to get this would be to use FireFox and firebug, and use the ajax call to see 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 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 returned. How you get it is up to you. Dump out the result, send it to you in an email, add it to a textarea, call the page directly or a dozen other ways. ~| 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:337718 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
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 the compiled source of the login page and told him a handful of ways to dump the source out so he can get it. I really thought that was pretty clear in my post. On Thu, Sep 30, 2010 at 7:31 PM, Andrew Scott andr...@andyscott.id.auwrote: Michael, injected code via Ajax will not appear in a view source. The best way to get this would be to use FireFox and firebug, and use the ajax call to see 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 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 returned. How you get it is up to you. Dump out the result, send it to you in an email, add it to a textarea, call the page directly or a dozen other ways. ~| 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:337719 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
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. Thanx for trying, but let's leave this problem as it lies. I'm obviously over my head and getting a cursor in a field just isn't worth the hassle. ~| 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:337720 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Trying to set cfform focus in an Ajax window
John, if you have firebug installed the easiest thing to do is make sure the console is open. You might need to enable it for your website, and when you do your ajax call you should see the request go through either in the console or net tabs. When you do you can click on the link and it will open up the information, from here you can click on the response tab and copy the text out. It actually isn't that hard once you understand what it is doing here. Regards, Andrew Scott http://www.andyscott.id.au/ -Original Message- From: John Pullam [mailto:jpul...@mcleansystems.com] 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. Thanx for trying, but let's leave this problem as it lies. I'm obviously over my head and getting a cursor in a field just isn't worth the hassle. ~| 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:337721 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Trying to set cfform focus in an Ajax window
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. 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 the compiled source of the login page and told him a handful of ways to dump the source out so he can get it. I really thought that was pretty clear in my post. ~| 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:337722 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
No worries. On Thu, Sep 30, 2010 at 8:15 PM, Andrew Scott andr...@andyscott.id.auwrote: 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. 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 the compiled source of the login page and told him a handful of ways to dump the source out so he can get it. I really thought that was pretty clear in my post. ~| 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:337723 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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 test, but couldn't you do this to pass parameters: cfset AjaxOnLoad('function(){init(someParam)}') / ~| 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:337632 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
: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 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)}') / ~| 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:337634 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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 jpul...@mcleansystems.comwrote: 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:337661 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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 jpul...@mcleansystems.comwrote: 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 jpul...@mcleansystems.com 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
Re: Trying to set cfform focus in an Ajax window
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 jpul...@mcleansystems.comwrote: 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 doing that). ~| 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:337597 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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)}') / ~| 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:337599 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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 isn't resolving the focus() ... is it perhaps trying to do that at the wrong time? My JavaScript/firebug skills are not far enough along to be able to understand the DOM when I look at it. But it seems to me that I've tried every combo of id and name and of trying to access the field in my JavaScript and still nothing. Can anyone suggest something I should look for in the DOM? ~| 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:337571 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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 with something in your code vs. a restriction in javascript or a browser. Since we know this now the only way to move forward is for you to post your code. On Mon, Sep 27, 2010 at 9:06 AM, John Pullam jpul...@mcleansystems.comwrote: 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 isn't resolving the focus() ... is it perhaps trying to do that at the wrong time? My JavaScript/firebug skills are not far enough along to be able to understand the DOM when I look at it. But it seems to me that I've tried every combo of id and name and of trying to access the field in my JavaScript and still nothing. Can anyone suggest something I should look for in the DOM? ~| 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:337574 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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 template=../AutoLogin.cfm!--- Goes to member home page if it logged someone in --- !--- Either no cookie, or no valid auto-login so just show the splash page --- !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd; html head meta http-equiv=Content-Type content=text/html; charset=utf-8 titleWhitevale Golf Club/title link rel=stylesheet media=all type=text/css href=../WGCStyle10.css / script type=text/javascript function ChangeWidth() { var winW = 630; if (parseInt(navigator.appVersion)3) { if (navigator.appName==Netscape || navigator.appName==Opera) { winW = window.innerWidth; } if (navigator.appName.indexOf(Microsoft)!=-1) { winW = document.body.offsetWidth; } } document.images[image0].width = winW; } /script /head body OnLoad=ChangeWidth() id=SplashBody img id=image0 src=SplashHole4.jpg div id=SplashLogoa href=PublicHome.cfmimg SRC=SplashLogo.png border=0/a/div div id=SplashButtons a href=PublicHome.cfmimg SRC=../Buttons/LGuests.png hspace=25 border=0/a a href=javascript:ColdFusion.Window.show('Login');ColdFusion.navigate('../MemberLogin.cfm','Login'); img SRC=../Buttons/LMembers.png hspace=25 border=0/a/div cfinclude template=../LoginWindow.cfm /body /html Next the template LoginWindow which it calls: !--- The window used to display/process the member login --- cfwindow name=Login modal=true resizable=false title=Please login width=380 height=200 x=80 y=80 bodyStyle=font-size:12px; font-family: verdana; background-color: ##dcefd2; color: black; text-align: left; headerStyle=font-size:13px; font-weight:bold; font-family:Verdana; background-color: ##2e5327; color: white; text-align:left; cfajaximport tags=cfform, cfwindow scriptsrc=/CFIDE/scripts /cfwindow Next the entire template MemberLogin.cfm which it calls to process: cfset LoginMsg = True cfif IsDefined(FORM.AccessID) !--- Processing for the form postback (user clicked on submit) --- cfparam name=FORM.Remember default=No cfquery name=GetUser datasource=WGCClubUser SELECT UserName, FirstName, LastName, Password, GolfClassification, Sex, MemberID FROM Users WHERE Status = 'Active' AND UserName = '#FORM.AccessID#' /cfquery cfif (GetUser.RecordCount EQ 1) AND (FORM.Password EQ GetUser.Password) !--- Success: We have a member who has logged on successfully --- !--- Create a user's extension record if one doesn't exist --- cfquery name=GetExtCount datasource=#datasource# SELECT UserName FROM UserNameExt WHERE UserName = '#FORM.AccessID#' /cfquery cfif GetExtCount.RecordCount EQ 0 !--- Write a new blank one --- cfquery name=GetExtCount datasource=#datasource# INSERT INTO UserNameExt( UserName, LastLogin, AuthAdminEvents, AuthAdminContent, AuthAdminMarketing, AuthAdminUsers) VALUES (#FORM.AccessID#, #01/01/2001#, 0,0,0,0) /cfquery/cfif !--- We have a UserNameExt record, now update it with this login date --- cfquery datasource=#datasource# UPDATE UserNameExt SET LastLogin=#CreateODBCDateTime(Now())# WHERE UserName = '#FORM.AccessID#' /cfquery !--- Get the user's authorities --- cfquery name=GetExt datasource=#datasource# SELECT * FROM UserNameExt WHERE UserName = '#FORM.AccessID#' /cfquery !--- Remember stuff in the session variables --- cflock timeout=5 throwontimeout=no type=exclusive scope=session cfset Session.IsLoggedIn=True cfset Session.FirstName=GetUser.FirstName cfset Session.LastName=GetUser.LastName cfset Session.AccessID=GetUser.UserName cfset Session.LoggedInAccessID=GetUser.UserName cfset Session.Password=GetUser.Password cfset Session.Class=GetUser.GolfClassification cfset Session.Gender=GetUser.Sex cfset Session.Account=GetUser.MemberID cfset Session.AuthAdminUsers=False cfif GetExt.AuthAdminUsers EQ 1cfset Session.AuthAdminUsers=True/cfif cfset Session.AuthAdminEvents=False cfif GetExt.AuthAdminEvents EQ 1cfset
Re: Trying to set cfform focus in an Ajax window
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 jpul...@mcleansystems.comwrote: 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 template=../AutoLogin.cfm!--- Goes to member home page if it logged someone in --- !--- Either no cookie, or no valid auto-login so just show the splash page --- !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01//EN http://www.w3.org/TR/html4/strict.dtd; html head meta http-equiv=Content-Type content=text/html; charset=utf-8 titleWhitevale Golf Club/title link rel=stylesheet media=all type=text/css href=../WGCStyle10.css / script type=text/javascript function ChangeWidth() { var winW = 630; if (parseInt(navigator.appVersion)3) { if (navigator.appName==Netscape || navigator.appName==Opera) { winW = window.innerWidth; } if (navigator.appName.indexOf(Microsoft)!=-1) { winW = document.body.offsetWidth; } } document.images[image0].width = winW; } /script /head body OnLoad=ChangeWidth() id=SplashBody img id=image0 src=SplashHole4.jpg div id=SplashLogoa href=PublicHome.cfmimg SRC=SplashLogo.png border=0/a/div div id=SplashButtons a href=PublicHome.cfmimg SRC=../Buttons/LGuests.png hspace=25 border=0/a a href=javascript:ColdFusion.Window.show('Login');ColdFusion.navigate('../MemberLogin.cfm','Login'); img SRC=../Buttons/LMembers.png hspace=25 border=0/a/div cfinclude template=../LoginWindow.cfm /body /html Next the template LoginWindow which it calls: !--- The window used to display/process the member login --- cfwindow name=Login modal=true resizable=false title=Please login width=380 height=200 x=80 y=80 bodyStyle=font-size:12px; font-family: verdana; background-color: ##dcefd2; color: black; text-align: left; headerStyle=font-size:13px; font-weight:bold; font-family:Verdana; background-color: ##2e5327; color: white; text-align:left; cfajaximport tags=cfform, cfwindow scriptsrc=/CFIDE/scripts /cfwindow Next the entire template MemberLogin.cfm which it calls to process: cfset LoginMsg = True cfif IsDefined(FORM.AccessID) !--- Processing for the form postback (user clicked on submit) --- cfparam name=FORM.Remember default=No cfquery name=GetUser datasource=WGCClubUser SELECT UserName, FirstName, LastName, Password, GolfClassification, Sex, MemberID FROM Users WHERE Status = 'Active' AND UserName = '#FORM.AccessID#' /cfquery cfif (GetUser.RecordCount EQ 1) AND (FORM.Password EQ GetUser.Password) !--- Success: We have a member who has logged on successfully --- !--- Create a user's extension record if one doesn't exist --- cfquery name=GetExtCount datasource=#datasource# SELECT UserName FROM UserNameExt WHERE UserName = '#FORM.AccessID#' /cfquery cfif GetExtCount.RecordCount EQ 0 !--- Write a new blank one --- cfquery name=GetExtCount datasource=#datasource# INSERT INTO UserNameExt( UserName, LastLogin, AuthAdminEvents, AuthAdminContent, AuthAdminMarketing, AuthAdminUsers) VALUES (#FORM.AccessID#, #01/01/2001#, 0,0,0,0) /cfquery/cfif !--- We have a UserNameExt record, now update it with this login date --- cfquery datasource=#datasource# UPDATE UserNameExt SET LastLogin=#CreateODBCDateTime(Now())# WHERE UserName = '#FORM.AccessID#' /cfquery !--- Get the user's authorities --- cfquery name=GetExt datasource=#datasource# SELECT * FROM UserNameExt WHERE UserName = '#FORM.AccessID#' /cfquery !--- Remember stuff in the session variables --- cflock timeout=5 throwontimeout=no type=exclusive scope=session cfset Session.IsLoggedIn=True cfset Session.FirstName=GetUser.FirstName cfset Session.LastName=GetUser.LastName cfset Session.AccessID=GetUser.UserName cfset Session.LoggedInAccessID=GetUser.UserName cfset Session.Password=GetUser.Password cfset Session.Class=GetUser.GolfClassification cfset
Re: Trying to set cfform focus in an Ajax window
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! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337582 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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 if you can diagnose why you can't set access. Change your script block at the bottom to include some other stuff script alert(document.LoginForm); // this should alert [object] and if it does tells you at least that the object exists alert(document.LoginForm.name); // this should alert LoginForm alert(document.LoginForm.AccessID); .//this should alert [object][object] I believe. alert(document.LoginForm.AccessID.name); //this should alert AccessID. /script If all those alerts (or you can change them to console.log if you prefer) behave as I've written then the objects are all there and named properly and you _should_ be able to set focus as normal. That's a start anyway. On Mon, Sep 27, 2010 at 3:50 PM, John Pullam jpul...@mcleansystems.comwrote: 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! http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337583 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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 doing that). ~| 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:337585 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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 parameters to the function specified. In this case, you don't need any, but I've had several occasions where it would have been nice to be able to do that. On Mon, Sep 27, 2010 at 3:56 PM, John Pullam jpul...@mcleansystems.comwrote: 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 doing that). ~| 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:337587 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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 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. Either one will work, it's just a matter of whether or not your caller will be aware of the form and fieldname you want to focus on. HTH. On Sat, Sep 25, 2010 at 10:20 PM, John Pullam jpul...@mcleansystems.comwrote: 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 ID/b/td td width=100cfinput name=AccessID validate=range range=1000,4999 value=#DefAccessID# size=8 required=yes message=A valid Access ID is required //td /tr tr height=21 tdbPassword/b/td tdcfinput name=Password type=password value=#DefPassword# size=8 required=Yes message=A password is required //td /tr tr height=21 td colspan=2span class=fineprintRemember me on this computer/span cfset checked=IIf(DefRemember EQ Yes,'checked','') input type=checkbox name=Remember value=Yes #checked#/td /tr /table cfinput name=Submit type=image value=Submit src=../Buttons/MSubmit.png / /cfform script document.LoginForm.AccessID.focus(); /script It feels to me as though the JS can't find document.LoginForm.AccessID. Firebug freezes on that line but I'm not getting a clean error message. Is it possible that there is some new trick needed in CF 9? ~| 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:337558 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Trying to set cfform focus in an Ajax window
That is actually a good point Michael, and the other thing to note which catches a lot of people out, is that the functions should be along the lines of myFunction = function() {} as noted by Adobe in their docs. But having said this, I am almost positive that inline JS outside of a function 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 in an Ajax window 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 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. Either one will work, it's just a matter of whether or not your caller will be aware of the form and fieldname you want to focus on. HTH. ~| 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:337559 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
I thought about it a bit more and you're right, inline code should fire. So I did a test and I can get the following code to work and set focus after the ajax call. here's index.cfm !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head titleUntitled/title script src=/jscript/jquery-1.4.2.min.js/script script $(document).ready(function(){ $.ajax({ url: /testCode/getCode.cfm, context: document.body, success: function(data){ // do nothing; $('#mydata').html(data); }}); }); /script /head body DIV ID=mydata style=background-color:#eaeaea;border:1px solid #c7c7c7;height:400px;/div /body /html Here's getCode.cfm cfform name=LoginForm table id=LoginBox tr height=21 td width=100bAccess ID/b/td td width=100cfinput name=AccessID validate=range range=1000,4999 value= size=8 required=yes message=A valid Access ID is required //td /tr tr height=21 tdbPassword/b/td tdcfinput name=Password type=password value= size=8 required=Yes message=A password is required //td /tr tr height=21 td colspan=2span class=fineprintRemember me on this computer/spaninput type=checkbox name=Remember value=Yes/td /tr /table cfinput name=Submit type=image value=Submit src=../Buttons/MSubmit.png / /cfform script document.LoginForm.AccessID.focus(); /script On Sun, Sep 26, 2010 at 9:23 AM, Andrew Scott andr...@andyscott.id.auwrote: That is actually a good point Michael, and the other thing to note which catches a lot of people out, is that the functions should be along the lines of myFunction = function() {} as noted by Adobe in their docs. But having said this, I am almost positive that inline JS outside of a function 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 in an Ajax window 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 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. Either one will work, it's just a matter of whether or not your caller will be aware of the form and fieldname you want to focus on. HTH. ~| 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:337560 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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 ID/b/td td width=100cfinput name=AccessID validate=range range=1000,4999 value=#DefAccessID# size=8 required=yes message=A valid Access ID is required //td /tr tr height=21 tdbPassword/b/td tdcfinput name=Password type=password value=#DefPassword# size=8 required=Yes message=A password is required //td /tr tr height=21 td colspan=2span class=fineprintRemember me on this computer/span cfset checked=IIf(DefRemember EQ Yes,'checked','') input type=checkbox name=Remember value=Yes #checked#/td /tr /table cfinput name=Submit type=image value=Submit src=../Buttons/MSubmit.png / /cfform script document.LoginForm.AccessID.focus(); /script It feels to me as though the JS can't find document.LoginForm.AccessID. Firebug freezes on that line but I'm not getting a clean error message. Is it possible that there is some new trick needed in CF 9? ~| 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:337552 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Trying to set cfform focus in an Ajax window
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/ ~| 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:337454 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
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 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/ ~| 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:337455 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
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: script document.LoginForm.AccessID.focus(); /script On Fri, Sep 24, 2010 at 8:46 AM, John Pullam jpul...@mcleansystems.comwrote: 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 pPlease identify yourself, then press quot;Submitquot;/p cfelse p class=errormsgIncorrect Access ID or Password. Please try again./p/cfif cfoutput cfform id=LoginForm onload=document.LoginForm.AccessID.focus(); table id=LoginBox tr height=21 td width=100bAccess ID/b/td td width=100cfinput name=AccessID validate=range range=1000,4999 value=#DefAccessID# size=8 required=yes message=A valid Access ID is required //td /tr tr height=21 tdbPassword/b/td tdcfinput name=Password type=password value=#DefPassword# size=8 required=Yes message=A password is required //td /tr tr height=21 td colspan=2span class=fineprintRemember me on this computer/span cfset checked=IIf(DefRemember EQ Yes,'checked','') input type=checkbox name=Remember value=Yes #checked#/td /tr /table cfinput name=Submit type=image value=Submit src=../Buttons/MSubmit.png / /cfform/cfoutput/div ~| 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:337456 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
... 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 that form has an onload function. Just put this at the bottom of your code: script document.LoginForm.AccessID.focus(); /script On Fri, Sep 24, 2010 at 8:46 AM, John Pullam jpul...@mcleansystems.comwrote: 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 pPlease identify yourself, then press quot;Submitquot;/p cfelse p class=errormsgIncorrect Access ID or Password. Please try again./p/cfif cfoutput cfform id=LoginForm onload=document.LoginForm.AccessID.focus(); table id=LoginBox tr height=21 td width=100bAccess ID/b/td td width=100cfinput name=AccessID validate=range range=1000,4999 value=#DefAccessID# size=8 required=yes message=A valid Access ID is required //td /tr tr height=21 tdbPassword/b/td tdcfinput name=Password type=password value=#DefPassword# size=8 required=Yes message=A password is required //td /tr tr height=21 td colspan=2span class=fineprintRemember me on this computer/span cfset checked=IIf(DefRemember EQ Yes,'checked','') input type=checkbox name=Remember value=Yes #checked#/td /tr /table cfinput name=Submit type=image value=Submit src=../Buttons/MSubmit.png / /cfform/cfoutput/div ~| 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:337458 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Trying to set cfform focus in an Ajax window
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. 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 ~| 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:337459 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set 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 name=myText /cfform On Fri, Sep 24, 2010 at 9:17 AM, Andrew Scott andr...@andyscott.id.auwrote: 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. 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 ~| 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:337460 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Trying to set cfform focus in an Ajax window
Well 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 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 name=myText /cfform ~| 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:337461 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
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. On Fri, Sep 24, 2010 at 9:31 AM, Andrew Scott andr...@andyscott.id.auwrote: Well 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 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 name=myText /cfform ~| 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:337462 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
RE: Trying to set cfform focus in an Ajax window
Michael, if you think that someone who has been developing CF for 15 years thinks that way then go preach to someone 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 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. ~| 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:337463 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm
Re: Trying to set cfform focus in an Ajax window
Andrew. I'm not preaching. You said something incorrect about how to target a form field. Then you made a comment about a method of the form tag that doesn't exist. Then you asked a question which gave the impression that you didn't realize that cfform actually creates a form tag. I don't think it was a leap in logic to assume you thought that cf tags existed outside of cf. I didn't realize you've been using Cold Fusion since it was released in 1995. One would think that a dev with that much experience would have realized why I referenced form when talking about cfform I'm not trying to insult you. I was simply correcting you. My apologies for misunderstanding your level of knowledge. On Fri, Sep 24, 2010 at 9:36 AM, Andrew Scott andr...@andyscott.id.auwrote: Michael, if you think that someone who has been developing CF for 15 years thinks that way then go preach to someone 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 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. ~| 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:337465 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm