Hi,
I'm using asp to display the editor. Here's the html clip for the editor:
Output Text :
<%
Dim FCK_outputText
Set FCK_outputText = New FCKeditor
FCK_outputText.BasePath = "/FCKeditor/"
FCK_outputText.Height = 300
FCK_outputText.ToolbarSet = "Basic"
FCK_outputText.Value = getPageValue("_davinci_FormulaBuildInstructions", "outputText")
FCK_outputText.Create "outputText"
%>
What's happening is that if I use the editor to help generate some text, and then attempt to load the form again, I'll get some text, and it's correct, but not right...for example, it'll display :
<ol> <li>Item One</li> <li>Item Two</li> </ol> <p>Done.</p>
Nothing will be parsed at all, it just shows the raw HTML. I can still use the editor as normal from there, but having it not parse is odd.
I've successfully used this exact same editor setup on a different form, with the exception of getting the .Value from a different source, so I'm not sure why this one is failing.
Perhaps someone can shed a little light on my confusion.
Thanks much!
BrianJ
I'm using asp to display the editor. Here's the html clip for the editor:
Output Text :
<%
Dim FCK_outputText
Set FCK_outputText = New FCKeditor
FCK_outputText.BasePath = "/FCKeditor/"
FCK_outputText.Height = 300
FCK_outputText.ToolbarSet = "Basic"
FCK_outputText.Value = getPageValue("_davinci_FormulaBuildInstructions", "outputText")
FCK_outputText.Create "outputText"
%>
What's happening is that if I use the editor to help generate some text, and then attempt to load the form again, I'll get some text, and it's correct, but not right...for example, it'll display :
<ol> <li>Item One</li> <li>Item Two</li> </ol> <p>Done.</p>
Nothing will be parsed at all, it just shows the raw HTML. I can still use the editor as normal from there, but having it not parse is odd.
I've successfully used this exact same editor setup on a different form, with the exception of getting the .Value from a different source, so I'm not sure why this one is failing.
Perhaps someone can shed a little light on my confusion.
Thanks much!
BrianJ

RE: FCKeditor Not Parsing Value on Load.
I had the same problem and wasted one whole day on it. For some reason if you set the value like this with PHP:
...
$oFCKeditor->Value = $HTMLcontent;
$oFCKeditor->Create(); // wont parse the HTML
so instead I made a hidden variable:
<input name="fckval" type="hidden" value="echo($HTMLcontent)" />
then the FCKeditor would be in javascript:
<script type="text/javascript">
var oFCKeditor = new FCKeditor( 'body' ) ;
oFCKeditor.BasePath = "templates/martha/FCKeditor/" ;
oFCKeditor.Height = 300;
oFCKeditor.Value = document.forms[0].fckval.value ;
oFCKeditor.Create();
</script>
content is parsed so I can edit HTML again. Weird but works at least.
RE: FCKeditor Not Parsing Value on Load.
<p>test</p>
encoded value is:
<p>test</p>
When you use a form field, the actual html above is automatically getting encoded. When you use java script, you are setting actual html. I recommend using the above posters method, even if you know how to encode the html in javascript.
Often your html wraps to new lines, and javascript has a bad time with line wrapping in syntax. So if you have:
var markup = <serverside variable here>
which actually ends up being:
var markup = '<p>test</p'>';
It would work if you encoded it. But, if it worked out to:
var markup = '<p> test </p>
<p>line 2</p>
<p>line 3</p>';
You would get javascript errors since javascript doesn't work well across multiple lines.
I am using my code with Struts, and have not completely tested it yet, but this seems to work:
Above in javaScript section
<script type="text/javascript" src="../fckeditor.js"></script>
<SCRIPT language ="javascript">
var markup;
function setDescription()
{
var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ;
markup = oEditor.GetXHTML(true);
document.featuredItemFormBean.pageMarkup.value = markup; }
Down in the html form section I have
<input type="hidden" name="pageMarkup" value='<bean:write name="featuredItemFormBean" property="pageMarkup"/>'/>
<script type="text/javascript">
<!--
var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ;
oFCKeditor.BasePath = '/admin/' ;
oFCKeditor.Value = document.featuredItemFormBean.pageMarkup.value ;
oFCKeditor.ToolbarSet = 'WEEK';
oFCKeditor.Create() ;
//-->
</script>
and on the submit button I have:
<html:submit property="action" onclick="setDescription()">Save Feature</html:submit>