House of Fusion
Home of the ColdFusion Community
Hostmysite ColdFusion Hosting

Search cf-talk

September 06, 2008

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30         

Subscribe Now
Fusion Authority Quarterly Update - ColdFusion 8 Special Edition

For ColdFusion hosting try HostMySite.com.
Search over 2,500 ColdFusion resources here  >>>      
Home /  Groups /  ColdFusion Talk (CF-Talk)

Multiple "onLoads" on <body> tag?

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Hi,
Bushy
05/12/03 07:34 A
> <body onload="KeepAlive()">
Matthew Walker
05/12/03 07:44 A
Three possible options:
Andre Mohamed
05/12/03 07:45 A
Thank
Bushy
05/12/03 07:46 A
Hmm...
Bushy
05/12/03 07:50 A
Nevermind...I got it to work.
Bushy
05/12/03 07:53 A

05/12/2003 07:34 AM
Author:
Bushy

Hi, Currently I have the following body tag: <body onload="KeepAlive()"> I would also like to add the below onload function. How can I add this to the above tag? Can you have multiple onloads? onLoad="formName.fieldName.focus();

05/12/2003 07:44 AM
Author:
Matthew Walker

> <body onload="KeepAlive()"> > > I would also like to add the below onload function. How can I add this to the above tag? Can you have multiple onloads? > > onLoad="formName.fieldName.focus(); Like this: <body onload="KeepAlive();formName.fieldName.focus();"> Actually here's something I sometimes do: <cfset request.bodyOnLoad = ""> <cfset request.bodyOnLoad = listappend(request.bodyOnLoad, "KeepAlive()", ";")> <cfset request.bodyOnLoad = listappend(request.bodyOnLoad, "formName.fieldName.focus()", ";")> <body onload="#request.bodyOnLoad#">

05/12/2003 07:45 AM
Author:
Andre Mohamed

Three possible options: 1) Use a semi-colon between statements e.g. <body onLoad="KeepAlive();formName.fieldName.focus();"> 2) Or use a generic onLoad function which contains calls to other functions e.g. <script language="Javascript">   function myOnLoad() {     KeepAlive();     formName.fieldName.focus();     //etc. etc.   } </script> Then: <body onLoad="myOnLoad()"> 3) Override the onLoad event for the document e.g. document.onLoad = myOnLoad; And repeat as above. With this option you don't need to place an onLoad event handler in the body tag. Hope that helps. AndrĂ© Hi, Currently I have the following body tag: <body onload="KeepAlive()"> I would also like to add the below onload function. How can I add this to the above tag? Can you have multiple onloads? onLoad="formName.fieldName.focus();

05/12/2003 07:38 AM
Author:
Dave Sueltenfuss

What you would want to do is build a function in your JavaScript, which both calls the KeepAlive() function, an then set the focus to the field you want. You then refer to this new function in the onload statement on the body tag Dave Hi, Currently I have the following body tag: <body onload="KeepAlive()"> I would also like to add the below onload function. How can I add this to the above tag? Can you have multiple onloads? onLoad="formName.fieldName.focus();

05/12/2003 07:40 AM
Author:
Pascal Peters

<body onload="KeepAlive();formName.fieldName.focus();"> OR create an onload function <script language="JavaScript" type="text/javascript"> <!-- Function initPage(){   KeepAlive();   formName.fieldName.focus(); } // --> </script> ... <body onload="initPage();"> Hi, Currently I have the following body tag: <body onload="KeepAlive()"> I would also like to add the below onload function. How can I add this to the above tag? Can you have multiple onloads? onLoad="formName.fieldName.focus();

05/12/2003 07:46 AM
Author:
Bushy

Thanks

05/12/2003 07:50 AM
Author:
Bushy

Hmm... I just tried the below code and the cursor won't appear in my form field? --script language="JavaScript" type="text/javascript"-- <!--   Function initPage(){     KeepAlive();     processFormSubmission.AccountNumber.focus();   } // --> --/script-- <body onload="initPage();"> Could there be a conflict with other JS I'm loading between my <head>...</head> tags?

05/12/2003 07:53 AM
Author:
Bushy

Nevermind...I got it to work. Thanks

05/12/2003 07:42 AM
Author:
Pascal Peters

Due to outlook there is an error in my script. It should say: function initPage(){ <body onload="KeepAlive();formName.fieldName.focus();"> OR create an onload function <script language="JavaScript" type="text/javascript"> <!-- Function initPage(){   KeepAlive();   formName.fieldName.focus(); } // --> </script> ... <body onload="initPage();"> Hi, Currently I have the following body tag: <body onload="KeepAlive()"> I would also like to add the below onload function. How can I add this to the above tag? Can you have multiple onloads? onLoad="formName.fieldName.focus();


<< Previous Thread Today's Threads Next Thread >>

Mailing Lists