House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
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
Thanks
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
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bushy
05/12/2003 07:34 AM

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();

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Matthew Walker
05/12/2003 07:44 AM

> <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#">

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Andre Mohamed
05/12/2003 07:45 AM

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();

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Sueltenfuss
05/12/2003 07:38 AM

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();

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Pascal Peters
05/12/2003 07:40 AM

<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();

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bushy
05/12/2003 07:50 AM

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? ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Pascal Peters
05/12/2003 07:42 AM

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 >>

Search cf-talk

May 18, 2013

<<   <   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 31   

Designer, Developer and mobile workflow conference