Hi,
After a long foray into the world of troubleshooting version 1.6 and trying to get it to function on vista unsuccessfully, we tested the new version and vista accepts it just fine. however integrating the editor into our fckeditor 1.6 compatible site has been somewhat tedious, i have the editor loading, and it correctly loads the passed Data to be edited from say.. an "existing entry" on my website, however i run a small javascript function to return the data back to the cell being edited on hte main page, it works like this
I have a page with various cells, each can trigger the fckeditor WYSIWYG, a page called CreateHtmlEditor_v2_page.cfm is loaded in a new window, the code is below.. This page is the page i've been updating to correctly pass information to, and recieve it from the fckeditor applet. I am stuck on HOW to access the data in the editing cell of the iframe... i'm not the best at java script so guessing the correct javascript as well as the correct variable to access creates a mountain of possibilities and 8 hours later my guess has gotten me nowhere:( here is the CreateHtmlEditor_v2_page.cfm code some is not used anymore, its just a modification of hte page that was in operation with version 1.6
the important part is this bit
function synchToParent(){
//iframe_#attributes.fieldname#.switchEditMode();
window.opener.document.#attributes.formname#.#attributes.fieldname#.value = ???????????????
window.close();
}
the left side of the operation window.opener works just fine i've tried replacing the ??? with static " blahblahblah "; and blahblahblah appears back in the cell. but i just dont know what javascript should go in place to actually retrieve the new HTML from the fckeditor!?!??!?!?
I haven't changed the coding of fckeditor or its config away from normal other than to point it to the correct document root etc.
from what i can guess, the ID of the texteditor area itself is.... fckEditor.instanceName or #attributes.fieldname#
but.. i've no idea how to access that, and i've looked throuh the code and found that the ID of the Iframe is "#attributes.instanceName#___Frame"
But without being knowledgeable at JS, i have no idea how to retrieve the data itself. please help me!!!, and thanks for surviving this far into my giant post - i hope it contains enough information to allow for an answer.
After a long foray into the world of troubleshooting version 1.6 and trying to get it to function on vista unsuccessfully, we tested the new version and vista accepts it just fine. however integrating the editor into our fckeditor 1.6 compatible site has been somewhat tedious, i have the editor loading, and it correctly loads the passed Data to be edited from say.. an "existing entry" on my website, however i run a small javascript function to return the data back to the cell being edited on hte main page, it works like this
I have a page with various cells, each can trigger the fckeditor WYSIWYG, a page called CreateHtmlEditor_v2_page.cfm is loaded in a new window, the code is below.. This page is the page i've been updating to correctly pass information to, and recieve it from the fckeditor applet. I am stuck on HOW to access the data in the editing cell of the iframe... i'm not the best at java script so guessing the correct javascript as well as the correct variable to access creates a mountain of possibilities and 8 hours later my guess has gotten me nowhere:( here is the CreateHtmlEditor_v2_page.cfm code some is not used anymore, its just a modification of hte page that was in operation with version 1.6
<cfparam name="url.title" default="Text"> <cfparam name="url.form" default="process"> <cfparam name="url.fieldname" default="text"> <cfparam name="attributes.title" default="#urldecode(url.title)#"> <cfparam name="attributes.fieldname" default="#url.fieldname#"> <cfparam name="attributes.formname" default="#url.form#"> <cfparam name="attributes.notes" default=""> <cfparam name="attributes.width" default="600"> <cfparam name="attributes.height" default="430"> <cfparam name="attributes.name" default="f#attributes.title#"> <cfparam name="attributes.required" default=""> <cfparam name="attributes.size" default="30"> <cfparam name="attributes.value" default=" "> <cfparam name="attributes.baseurl" default="#config.baseurl#"> <cfparam name="attributes.rightcolour" default=""> <cfparam name="attributes.leftcolour" default=""> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <cfoutput> <title>#config.clientname# WYSIWYG Editor</title> <script language="JavaScript"> function getData(){ #attributes.fieldname#.value = window.opener.document.#attributes.formname#.#attributes.fieldname#.value; } function synchToParent(){ //iframe_#attributes.fieldname#.switchEditMode(); window.opener.document.#attributes.formname#.#attributes.fieldname#.value = ???????????????? window.close(); } </script> </cfoutput> </head> <body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0" marginheight="0" marginwidth="0" bgcolor="#C6F347" Onload="getData()"> <cfoutput> <table width="100%" border="0" cellpadding="5" cellspacing="0"> <tr> <td colspan="2" bgcolor="#attributes.rightcolour#" <cfif len(attributes.notes)>title="#attributes.notes#"</cfif>> <!---FCK 1.6 <cfmodule template="FCKeditor/fckeditor.cfm" adminurl="#config.adminurl#" baseurl="#config.homeurl#" instanceName="#attributes.fieldname#" width="605" height="530" toolbarSetName="" canUpload="" canBrowse="" initialValue="">---> <cfscript> // Calculate basepath for FCKeditor. It's in the folder right above _samples basePath = "/admin/fckeditor/"; fckEditor = createObject("component", "#basePath#fckeditor"); fckEditor.instanceName = "#attributes.fieldname#"; fckEditor.value = "#attributes.fieldname#.value"; fckEditor.basePath = "/admin/fckeditor"; fckEditor.width = 605; fckEditor.height = 530; fckEditor.create(); // create the editor. </cfscript> <input type="submit" name="submit" value=" Update " Onclick="synchToParent()"> <input type="button" name="submit" value=" Close " onClick="window.close();"> </td> </tr> </table> </cfoutput> </body> </html>
the important part is this bit
function synchToParent(){
//iframe_#attributes.fieldname#.switchEditMode();
window.opener.document.#attributes.formname#.#attributes.fieldname#.value = ???????????????
window.close();
}
the left side of the operation window.opener works just fine i've tried replacing the ??? with static " blahblahblah "; and blahblahblah appears back in the cell. but i just dont know what javascript should go in place to actually retrieve the new HTML from the fckeditor!?!??!?!?
I haven't changed the coding of fckeditor or its config away from normal other than to point it to the correct document root etc.
from what i can guess, the ID of the texteditor area itself is.... fckEditor.instanceName or #attributes.fieldname#
but.. i've no idea how to access that, and i've looked throuh the code and found that the ID of the Iframe is "#attributes.instanceName#___Frame"
But without being knowledgeable at JS, i have no idea how to retrieve the data itself. please help me!!!, and thanks for surviving this far into my giant post - i hope it contains enough information to allow for an answer.
Re: Javascript data access problem
Re: Javascript data access problem
Inserted that line and its working perfectly, thankyou very much!!:)