I'm creating a number of FCKeditor instances on a page using the following PHP:
This works perfectly, until I add a second instance at which point the second editor refuses to post content as HTML. E.g.
In the second code example above, the returned value for "FCKeditor2" will be plain text.
I'm using the code within the CubeCart ecommerce software where I've had this working perfectly in the past on other CubeCart sites, but can't work out why it's not working now.
$oFCKeditor = new FCKeditor('FCKeditor'); $oFCKeditor->Value = $somevalue; $oFCKeditor->Create();
This works perfectly, until I add a second instance at which point the second editor refuses to post content as HTML. E.g.
$oFCKeditor = new FCKeditor('FCKeditor'); $oFCKeditor->Value = $somevalue; $oFCKeditor->Create(); $oFCKeditor2 = new FCKeditor('FCKeditor2'); $oFCKeditor2->Value = $somevalue2; $oFCKeditor2->Create();
In the second code example above, the returned value for "FCKeditor2" will be plain text.
I'm using the code within the CubeCart ecommerce software where I've had this working perfectly in the past on other CubeCart sites, but can't work out why it's not working now.
Re: FCKeditor strips HTML when not named 'FCKeditor'
If you place each editor into a form, then you can avoid much renaming totally.
You need only name the refering page fo rthe form and teh instance name of the editor in the form.
All the rest of the settings can be duplicated.
Here is an example of 2 editors in a page:
<form name="left" action="thispage.php" method="post">
<?
$query = mysql_query("enter your query if using db");
$data = mysql_fetch_array($query);
$oFCKeditor = new FCKeditor('content1');
$oFCKeditor->BasePath = "fckeditor/";
$oFCKeditor->Config['EnterMode'] = 'div';
$oFCKeditor->Value = $data["content"];
$oFCKeditor->Width = 780;
$oFCKeditor->Height = 150;
$oFCKeditor->ToolbarSet = 'WideContent' ;
echo $oFCKeditor->Create();
?>
<input type="hidden" name="left" value="1" />
</form>
<form name="right" action="thispage.php" method="post">
<?
$query = mysql_query("enter your query if using db");
$data = mysql_fetch_array($query);
$oFCKeditor = new FCKeditor('content2');
$oFCKeditor->BasePath = "fckeditor/";
$oFCKeditor->Config['EnterMode'] = 'div';
$oFCKeditor->Value = $data["content"];
$oFCKeditor->Width = 780;
$oFCKeditor->Height = 500;
$oFCKeditor->ToolbarSet = 'WideContent' ;
echo $oFCKeditor->Create();
?>
<input type="hidden" name="right" value="1" />
</form>
Good luck,
dennishall