Hello,
Question: how can I move FCKeditor-output as hidden field thru another php-page?
Details:
I use FCKeditor in an ecard-form tp write the message. Before storing in database, a preview of the ecard is shown to the user.
Therefore I open a new page, where the message is needed as hidden field to have it available for later db-storing.
Problem is: in the hidden field the value is $message, the html-text FCKeditor created. The problem is, that the html-code gets corrupted because it is interpreted. I think this happens, when e.g. font-color is set (the double-quote " makes one of the problems).
Question: how can I move FCKeditor-output as hidden field thru another php-page?
Thanks in advance
Question: how can I move FCKeditor-output as hidden field thru another php-page?
Details:
I use FCKeditor in an ecard-form tp write the message. Before storing in database, a preview of the ecard is shown to the user.
Therefore I open a new page, where the message is needed as hidden field to have it available for later db-storing.
Problem is: in the hidden field the value is $message, the html-text FCKeditor created. The problem is, that the html-code gets corrupted because it is interpreted. I think this happens, when e.g. font-color is set (the double-quote " makes one of the problems).
Question: how can I move FCKeditor-output as hidden field thru another php-page?
Thanks in advance
RE: FCKeditor-output as hidden field
RE: FCKeditor-output as hidden field
You can place a HIDDEN field in the page. When you want to make a preview, you can get the text content using GetXHTML method of the editor instance and write that text into the hidden field, for example,
var oEditor = FCKeditorAPI.GetInstance('message') ;
if (!oEditor || oEditor.GetXHTML(true).replace(/ /g, '') == '')
{
alert('You have to write the body of the message');
oEditor.Focus();
return false;
}
document.frm.hidden_field.value = oEditor.GetXHTML(true);
document.frm.submit();
In PHP page you retrieve the field using, for example, $hidden_field variable.
I know this can be slow for very very large texts, but it will behave good in most cases.
Jaime
RE: FCKeditor-output as hidden field
Jaime