jsmonkey
Posts: 39
|
Posted: 03/15/2011, 4:42 PM |
|
Hi all,
I have a textarea that gets populated by an autofill, then the user can choose to edit the text and submit. I wanted to beautify the text with html so I added fckeditor onload event to replace the text area. fckeditor appars and works properly but will not autofill. I tried reading the value of the fckeditor/textarea using some javascript but cant for some reason. Does changing the textarea to an fckeditor change the control name??
ANY advice you can give would be appreciated!
-J
_________________
-J |
|
|
TheunisP
Posts: 342
|
Posted: 03/15/2011, 5:03 PM |
|
once the fckeditor is initiated you are not working with the text area anymore - to change the content of the editor you need to access its properties via its API - which is available through javascript
|
|
|
jsmonkey
Posts: 39
|
Posted: 03/16/2011, 7:31 AM |
|
can you give me an example of using javascript to say... alert( the contents of the fckeditor)?
I guess my question summary is: In CCS what is the fckeditor instance name? I tried this:
<script language="javascript">
function fitalert(){
var fitdata = FCKeditorAPI.GetInstance(this.getAttribute("id"));
alert(fitdata);
}
</script>
based on this in CCS:
//Attach FCKeditor @328-6651DADD
try {
var reportdataquestiontext_FCK = new FCKeditor(this.getAttribute("id"));
reportdataquestiontext_FCK.BasePath = "/fitwac/fckeditor/";
reportdataquestiontext_FCK.ToolbarSet = "Basic";
reportdataquestiontext_FCK.Height = "200";
reportdataquestiontext_FCK.Width = "750";
reportdataquestiontext_FCK.ReplaceTextarea();
} catch (e) {}
//End Attach FCKeditor
Thank you
_________________
-J |
|
|
TheunisP
Posts: 342
|
Posted: 03/16/2011, 8:17 AM |
|
the fitdata as you have will have the instance of that editor you now can call the API e.g. fitdata.method
it seems to be the GetHTML you need - check this page:
http://docs.cksource.com/FCKeditor_2.x/Developers_Guide/JavaScript_API
|
|
|
Waspman
Posts: 948
|
Posted: 03/29/2011, 12:36 AM |
|
did you sort this? If not try NicEdit
_________________
http://www.waspmedia.co.uk |
|
|
jsmonkey
Posts: 39
|
Posted: 03/30/2011, 6:16 AM |
|
Waspman: no, it is still outstanding. I submitted a support case and they replied that they were turning it over to the developers...
In the end, what seems to be problem is the instance name in: "var fitdata = FCKeditorAPI.GetInstance(this.getAttribute("id"))"
do you know what the instance name is or where to find it?
_________________
-J |
|
|
Waspman
Posts: 948
|
Posted: 03/31/2011, 2:49 AM |
|
Are you using the Autofill function? if so why?
Did you try "nicedit"?
_________________
http://www.waspmedia.co.uk |
|
|
jsmonkey
Posts: 39
|
Posted: 04/01/2011, 11:59 AM |
|
Yes, I am using Autofill to drop some initial text into the text area (based on some dropdown selections earlier in the workflow). The user gets to edit text if they wish. This text ends up in a form letter. All of my text has been HTML formatted, so, I figured it would be easier to have a WYSIWYG text area.
I'll try nicedit and post a reply. Thanks!!
_________________
-J |
|
|
Waspman
Posts: 948
|
Posted: 04/02/2011, 8:48 AM |
|
Never used autofill, not sure what it's for:)
But I have done what you are trying to do. Simply setting session/url variables as the user travels through the app. Then when arriving at the form using a simple script to get the data from a table based on a condition; if CCGetSession("value") = whatever then go get the data in field whatever table whatever. That sort of thing.
T
_________________
http://www.waspmedia.co.uk |
|
|