Re: input box focus
Use the following JS code once the page is loaded: document.getElementById ( 'input_id' ).focus(); Obviously, 'input_id' is the value of the id attribute for the textbox. On 4/12/06, David Elliott [EMAIL PROTECTED] wrote: Hi all, just an easy question probably, I wrote my first two pages yesterday and need to add something else to them. Unfortunately, I don't have my 'book' with me but I would like the cursor to appear inside this one and only text box when the page opens up. I guess VBA access has spoiled me some Any help greatly appreciated, Dave ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237550 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: input box focus
does this code need to appear in any certain area of the web page? i.e. body, head ?? --- Bryan Stevenson [EMAIL PROTECTED] wrote: coming from memorybut some JavaScript along these lines should work: script language=JavaScript onLoad = document.yourFormName.yourfieldThatNeedsFocusName.focus(); /script HTH Cheers Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: [EMAIL PROTECTED] web: www.electricedgesystems.com ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237551 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: input box focus
Yeah, it should go in your head. head script type=text/javascript the javascript... /script /head On 4/12/06, David Elliott [EMAIL PROTECTED] wrote: does this code need to appear in any certain area of the web page? i.e. body, head ?? --- Bryan Stevenson [EMAIL PROTECTED] wrote: coming from memorybut some JavaScript along these lines should work: script language=JavaScript onLoad = document.yourFormName.yourfieldThatNeedsFocusName.focus(); /script HTH Cheers Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: [EMAIL PROTECTED] web: www.electricedgesystems.com ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237552 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: input box focus
None of the suggestions work for me, but here is the code for the entire page...remember, I am just learning coldfusion so don't laugh yourself sick... Dave --- Ryan Guill [EMAIL PROTECTED] wrote: javascript code: window.onload = document.myformname.myforminput.focus(); where myformname is the name= of the form tag and myforminput is the id (i think, it may be name=) of the form element you want to focus to. On 4/12/06, David Elliott [EMAIL PROTECTED] wrote: Hi all, just an easy question probably, I wrote my first two pages yesterday and need to add something else to them. Unfortunately, I don't have my 'book' with me but I would like the cursor to appear inside this one and only text box when the page opens up. I guess VBA access has spoiled me some Any help greatly appreciated, Dave ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237558 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: input box focus
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 titleDave's Query/title script language=JavaScript window.onload = document.yardage_ticket_no.yardage_ticket_no.focus(); /script /head body cfform action=DaveActionForm.cfm Please enter yardage ticket number: cfinput type=text Name= yardage_ticket_no input type=submit Value = Submit /cfform /body /html --- David Elliott [EMAIL PROTECTED] wrote: None of the suggestions work for me, but here is the code for the entire page...remember, I am just learning coldfusion so don't laugh yourself sick... Dave --- Ryan Guill [EMAIL PROTECTED] wrote: javascript code: window.onload = document.myformname.myforminput.focus(); where myformname is the name= of the form tag and myforminput is the id (i think, it may be name=) of the form element you want to focus to. On 4/12/06, David Elliott [EMAIL PROTECTED] wrote: Hi all, just an easy question probably, I wrote my first two pages yesterday and need to add something else to them. Unfortunately, I don't have my 'book' with me but I would like the cursor to appear inside this one and only text box when the page opens up. I guess VBA access has spoiled me some Any help greatly appreciated, Dave ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237566 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: input box focus
You need a name on your form, cfform action=DaveActionForm.cfm name=myForm Then put myform in the js, document.myform.yardage_ticket_no.focus() On 4/12/06, David Elliott [EMAIL PROTECTED] wrote: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 titleDave's Query/title script language=JavaScript window.onload = document.yardage_ticket_no.yardage_ticket_no.focus(); /script /head body cfform action=DaveActionForm.cfm Please enter yardage ticket number: cfinput type=text Name= yardage_ticket_no input type=submit Value = Submit /cfform /body /html --- David Elliott [EMAIL PROTECTED] wrote: None of the suggestions work for me, but here is the code for the entire page...remember, I am just learning coldfusion so don't laugh yourself sick... Dave --- Ryan Guill [EMAIL PROTECTED] wrote: javascript code: window.onload = document.myformname.myforminput.focus(); where myformname is the name= of the form tag and myforminput is the id (i think, it may be name=) of the form element you want to focus to. On 4/12/06, David Elliott [EMAIL PROTECTED] wrote: Hi all, just an easy question probably, I wrote my first two pages yesterday and need to add something else to them. Unfortunately, I don't have my 'book' with me but I would like the cursor to appear inside this one and only text box when the page opens up. I guess VBA access has spoiled me some Any help greatly appreciated, Dave ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237572 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: input box focus
document.yardage_ticket_no.yardage_ticket_no.focus(); You DO NOT have a form named yardage_ticket_no so of course it won't work ;-) document.formName.fieldName.focus(); change your cfform tag to look like so: cfform action=DaveActionForm.cfm name=yardageForm and use this: document.yardageForm.yardage_ticket_no.focus(); HTH Cheers Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: [EMAIL PROTECTED] web: www.electricedgesystems.com ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237573 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: input box focus
still doesn't workmust be missing something else. I've tried it with the semi colon without on that line and have the same resultshere is the code again !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 titleDave's Query/title script language=JavaScript window.onload = document.myform.yardage_ticket_no.focus() /script /head body cfform action=DaveActionForm.cfm name=myform Please enter yardage ticket number: cfinput type=text Name= yardage_ticket_no input type=submit Value = Submit /cfform /body /html --- Ryan Guill [EMAIL PROTECTED] wrote: You need a name on your form, cfform action=DaveActionForm.cfm name=myForm Then put myform in the js, document.myform.yardage_ticket_no.focus() On 4/12/06, David Elliott [EMAIL PROTECTED] wrote: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 titleDave's Query/title script language=JavaScript window.onload = document.yardage_ticket_no.yardage_ticket_no.focus(); /script /head body cfform action=DaveActionForm.cfm Please enter yardage ticket number: cfinput type=text Name= yardage_ticket_no input type=submit Value = Submit /cfform /body /html --- David Elliott [EMAIL PROTECTED] wrote: None of the suggestions work for me, but here is the code for the entire page...remember, I am just learning coldfusion so don't laugh yourself sick... Dave --- Ryan Guill [EMAIL PROTECTED] wrote: javascript code: window.onload = document.myformname.myforminput.focus(); where myformname is the name= of the form tag and myforminput is the id (i think, it may be name=) of the form element you want to focus to. On 4/12/06, David Elliott [EMAIL PROTECTED] wrote: Hi all, just an easy question probably, I wrote my first two pages yesterday and need to add something else to them. Unfortunately, I don't have my 'book' with me but I would like the cursor to appear inside this one and only text box when the page opens up. I guess VBA access has spoiled me some Any help greatly appreciated, Dave ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237576 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: input box focus
make it cfinput type=text name=yardage_ticket_no id=yardage_ticket_no / then. On 4/12/06, David Elliott [EMAIL PROTECTED] wrote: still doesn't workmust be missing something else. I've tried it with the semi colon without on that line and have the same resultshere is the code again !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 titleDave's Query/title script language=JavaScript window.onload = document.myform.yardage_ticket_no.focus() /script /head body cfform action=DaveActionForm.cfm name=myform Please enter yardage ticket number: cfinput type=text Name= yardage_ticket_no input type=submit Value = Submit /cfform /body /html --- Ryan Guill [EMAIL PROTECTED] wrote: You need a name on your form, cfform action=DaveActionForm.cfm name=myForm Then put myform in the js, document.myform.yardage_ticket_no.focus() On 4/12/06, David Elliott [EMAIL PROTECTED] wrote: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 titleDave's Query/title script language=JavaScript window.onload = document.yardage_ticket_no.yardage_ticket_no.focus(); /script /head body cfform action=DaveActionForm.cfm Please enter yardage ticket number: cfinput type=text Name= yardage_ticket_no input type=submit Value = Submit /cfform /body /html --- David Elliott [EMAIL PROTECTED] wrote: None of the suggestions work for me, but here is the code for the entire page...remember, I am just learning coldfusion so don't laugh yourself sick... Dave --- Ryan Guill [EMAIL PROTECTED] wrote: javascript code: window.onload = document.myformname.myforminput.focus(); where myformname is the name= of the form tag and myforminput is the id (i think, it may be name=) of the form element you want to focus to. On 4/12/06, David Elliott [EMAIL PROTECTED] wrote: Hi all, just an easy question probably, I wrote my first two pages yesterday and need to add something else to them. Unfortunately, I don't have my 'book' with me but I would like the cursor to appear inside this one and only text box when the page opens up. I guess VBA access has spoiled me some Any help greatly appreciated, Dave ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237577 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: input box focus
Dave - Try this: script language=JavaScript window.onload = function() { document.myform.yardage_ticket_no.focus() }; /script I can't swear to this for built-in functions like focus(), but if I were calling a custom function, I would need to leave the parentheses off of your original statement. window.onload = mycustomfunction(); // would not work window.onload = mycustomfunction; // would work Maybe focus() operates the same way? On 4/12/06, David Elliott [EMAIL PROTECTED] wrote: still doesn't workmust be missing something else. I've tried it with the semi colon without on that line and have the same resultshere is the code again !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 titleDave's Query/title script language=JavaScript window.onload = document.myform.yardage_ticket_no.focus() /script /head body cfform action=DaveActionForm.cfm name=myform Please enter yardage ticket number: cfinput type=text Name= yardage_ticket_no input type=submit Value = Submit /cfform /body /html --- Ryan Guill [EMAIL PROTECTED] wrote: You need a name on your form, cfform action=DaveActionForm.cfm name=myForm Then put myform in the js, document.myform.yardage_ticket_no.focus() On 4/12/06, David Elliott [EMAIL PROTECTED] wrote: !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://www.w3.org/TR/html4/loose.dtd; html head meta http-equiv=Content-Type content=text/html; charset=iso-8859-1 titleDave's Query/title script language=JavaScript window.onload = document.yardage_ticket_no.yardage_ticket_no.focus(); /script /head body cfform action=DaveActionForm.cfm Please enter yardage ticket number: cfinput type=text Name= yardage_ticket_no input type=submit Value = Submit /cfform /body /html --- David Elliott [EMAIL PROTECTED] wrote: None of the suggestions work for me, but here is the code for the entire page...remember, I am just learning coldfusion so don't laugh yourself sick... Dave --- Ryan Guill [EMAIL PROTECTED] wrote: javascript code: window.onload = document.myformname.myforminput.focus(); where myformname is the name= of the form tag and myforminput is the id (i think, it may be name=) of the form element you want to focus to. On 4/12/06, David Elliott [EMAIL PROTECTED] wrote: Hi all, just an easy question probably, I wrote my first two pages yesterday and need to add something else to them. Unfortunately, I don't have my 'book' with me but I would like the cursor to appear inside this one and only text box when the page opens up. I guess VBA access has spoiled me some Any help greatly appreciated, Dave ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237579 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: input box focus
window.onload = document.myform.yardage_ticket_no.focus() add a semi-colon to the end document.myform.yardage_ticket_no.focus(); Also try the code I sent you ;-) What browser are you tesring with BTWthis can effect things Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: [EMAIL PROTECTED] web: www.electricedgesystems.com ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237580 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: input box focus
The line break after window.onload = could cause a problem (maybe?) On 4/12/06, Bryan Stevenson [EMAIL PROTECTED] wrote: window.onload = document.myform.yardage_ticket_no.focus() add a semi-colon to the end document.myform.yardage_ticket_no.focus(); Also try the code I sent you ;-) What browser are you tesring with BTWthis can effect things Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: [EMAIL PROTECTED] web: www.electricedgesystems.com ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237584 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: input box focus
The browser is IE Mozilla; makes no difference. I've tried all your suggestions but the input box never gets the focus. Perhaps it cannot be done. Perhaps I'll come across something more suitable in my book. Dave ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237585 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: input box focus
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN html head titleUntitled/title /head body onload=JavaScript:document.myForm.myField.focus(); form name=myForm action= method=post textarea name=myField/textarea /form /body /html this works fine in IE and Firefox hth Charlie Hanlon Web Apps Developer Food Service Enablers, Inc. www.fsenablers.com The People. The Platform. The Products. Make the Difference ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237587 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: input box focus
Perhaps CFFORM is messing with the form name? try a normal form tag and see if that helps Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: [EMAIL PROTECTED] web: www.electricedgesystems.com ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237588 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: input box focus
Just tested my code with cfform instead of form and still functions as desired. Charles Hanlon Senior Web Applications Developer Food Service Enablers, Inc. www.fsenablers.com The People. The Platform. The Products. Make the Difference - Original Message - From: Bryan Stevenson [EMAIL PROTECTED] To: CF-Talk cf-talk@houseoffusion.com Sent: Wednesday, April 12, 2006 2:30 PM Subject: Re: input box focus Perhaps CFFORM is messing with the form name? try a normal form tag and see if that helps Bryan Stevenson B.Comm. VP Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: [EMAIL PROTECTED] web: www.electricedgesystems.com ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237590 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: input box focus
Have you considered giving the input an id and then using document.getElementById('myInput').focus() I don't know why it would work when the other wouldn't, but you never know. -Original Message- From: David Elliott [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 12, 2006 12:19 PM To: CF-Talk Subject: Re: input box focus The browser is IE Mozilla; makes no difference. I've tried all your suggestions but the input box never gets the focus. Perhaps it cannot be done. Perhaps I'll come across something more suitable in my book. Dave ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237591 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: input box focus
It might just be CF's auto-generated JavaScript messing things up. On a site I've been working on we've been using plain HTML forms, but on one page we needed to use CFFORM. That one page messed with the focus and caused us to jump through a bunch of hoops so that it didn't break our 508 compliance. I ended up putting JavaScript at the bottom of the page (just before the closing BODY tag) to put the focus where I wanted it. -Original Message- From: Bryan Stevenson [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 12, 2006 2:31 PM To: CF-Talk Subject: Re: input box focus Perhaps CFFORM is messing with the form name? try a normal form tag and see if that helps ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237592 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: input box focus
Yeah I suspect the body onload is a better solution than an inline window.onload function definition; maybe the form object doesn't even exist in the dom until after that function gets kicked off or something. -Original Message- From: Charlie Hanlon [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 12, 2006 12:33 PM To: CF-Talk Subject: Re: input box focus Just tested my code with cfform instead of form and still functions as desired. Charles Hanlon Senior Web Applications Developer Food Service Enablers, Inc. www.fsenablers.com The People. The Platform. The Products. Make the Difference ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237593 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: input box focus
The over problem with the code is the coding within the inline javascript. It is case sensitive, i.e. myform is not the same as myForm. Once I changed that, it works beautifully. Thanks all! Dave --- Matt Williams [EMAIL PROTECTED] wrote: Possible DUH!... Make sure that javascript is enabled in whatever browser you are using. On 4/12/06, Paul [EMAIL PROTECTED] wrote: Yeah I suspect the body onload is a better solution than an inline window.onload function definition; maybe the form object doesn't even exist in the dom until after that function gets kicked off or something. -Original Message- From: Charlie Hanlon [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 12, 2006 12:33 PM To: CF-Talk Subject: Re: input box focus Just tested my code with cfform instead of form and still functions as desired. Charles Hanlon Senior Web Applications Developer Food Service Enablers, Inc. www.fsenablers.com The People. The Platform. The Products. Make the Difference ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237614 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: input box focus
I'd recommend using the getElementById over the formname.fieldname.focus(). And JS is parsed as it's read, for the most part, so simply putting scriptdocument.getElementById('fieldIDGoesHere').focus()/script AFTER the field should work. The bottom might be safer, and window.onload is swell if you have a multi window.onload function, as lots of JS stuff uses it, so a single window.onload = someFunction() kills other stuff, whereas window.onload = window.onload someFunction [not real code] will play nicer with others. Just more fyi type stuff. ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237651 Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4 Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4 Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54