|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
How to fire off onBlur event for CFTEXTAREA
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.Alex Sorokorensky 01/08/09 09:44 P CF 8's rich text area uses the FCKEditor. A little digging in their docsBrad Wood 01/08/09 11:56 P Brad, this code snippet works great by itself.Alex Sorokorensky 01/09/09 12:42 A I got it to work by moving the javascript code to the parent file (div.cfm) right after the cfdiv.Alex Sorokorensky 01/09/09 01:06 A 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 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 ----- 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 ----- 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 -----
|
March 21, 2010
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||