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

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

How to fire off onBlur event for CFTEXTAREA

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Alex Sorokorensky
01/08/2009 09:44 PM

CFTEXTAREA is great in CF8, but there seems to be a bug that the richtext editor will not react to onBlur events. For a regular textarea it works fine. Can anyone figure out a workaround for this? I just have a form with the 1 CFTEXTAREA field and want to submit it onBlur. -Alex

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Brad Wood
01/08/2009 11:56 PM

CF 8's rich text area uses the FCKEditor.  A little digging in their docs shows you how to do this.  You must attach the event after the editor loads like so: <cfform format="HTML" name="test"> <cftextarea name="myfield" richtext="Yes"></cftextarea> </cfform> <script LANGUAGE="JavaScript" TYPE="text/javascript">     function FCKeditor_OnComplete(editorInstance)   {    editorInstance.Events.AttachEvent( 'OnBlur', handleOnBlur ) ;   } function handleOnBlur(editorInstance)   {       alert(editorInstance.Name + ' has blurred!');   } </script> ~Brad ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Alex Sorokorensky
01/09/2009 12:42 AM

Brad, this code snippet works great by itself. However, as an additional level of complexity, I need to run that from a cfdiv which no longer fires off the OnBlur. There is a parent file called div.cfm which creates the cfdiv and binds to the file that contains your solution. <cfdiv bind="url:fckrte.cfm?section=1" bindonload="true" style="margin-top:10px;"> Any idea what needs to be changed so OnBlur will still work in this setup? ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Alex Sorokorensky
01/09/2009 01:06 AM

I got it to work by moving the javascript code to the parent file (div.cfm) right after the cfdiv. Thank you very much for finding this solution. -Alex ----- Excess quoted text cut - see Original Post for more -----


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

Search cf-talk

March 21, 2010

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