Hello,
I've gotten FCKeditor to display a form on a web page. When I try to assign the default value to the oFCKeditor.Value field, FCKeditor breaks. Here is the code that I'm using:
oFCKeditor.Value = '<?php echo $row['vcharContent']; ?>' ;
I believe that this has something to do with line breaks (<br>) that were created when the record was added to the database. When I view the source, this is what I see:
...
oFCKeditor.Value = '<p>Lorem ipsum dolor <br />
<br />
Loreutpat eros, vel consequat augue ullamcorper sed. Nunc eleifend lacus quam, quis posuere diam. Proin non risus justo, sit amet vehicula elit. Suspendisse in nisi lectus, sit amet dictum nisi. Pra. <br />
...
When I remove the line breaks, FCKeditor displays just fine:
...
oFCKeditor.Value = '<p>Lorem ipsum dolor <br /><br />Loreutpat eros, vel consequat augue ullamcorper sed. Nunc eleifend lacus quam, quis posuere diam. Proin non risus justo, sit amet vehicula elit. Suspendisse in nisi lectus, sit amet dictum nisi. Pra. <br />
...
Any assistance is greatly appreciated
I've gotten FCKeditor to display a form on a web page. When I try to assign the default value to the oFCKeditor.Value field, FCKeditor breaks. Here is the code that I'm using:
oFCKeditor.Value = '<?php echo $row['vcharContent']; ?>' ;
I believe that this has something to do with line breaks (<br>) that were created when the record was added to the database. When I view the source, this is what I see:
...
oFCKeditor.Value = '<p>Lorem ipsum dolor <br />
<br />
Loreutpat eros, vel consequat augue ullamcorper sed. Nunc eleifend lacus quam, quis posuere diam. Proin non risus justo, sit amet vehicula elit. Suspendisse in nisi lectus, sit amet dictum nisi. Pra. <br />
...
When I remove the line breaks, FCKeditor displays just fine:
...
oFCKeditor.Value = '<p>Lorem ipsum dolor <br /><br />Loreutpat eros, vel consequat augue ullamcorper sed. Nunc eleifend lacus quam, quis posuere diam. Proin non risus justo, sit amet vehicula elit. Suspendisse in nisi lectus, sit amet dictum nisi. Pra. <br />
...
Any assistance is greatly appreciated
Re: Pulling data from database to oFCKeditor.Value field
...
<?php
$line = ereg_replace("/\n\r|\r\n|\n|\r/", "", $row['vcharContent']);
$line = preg_replace("/\t/", "", $line);
?>
...
oFCKeditor.Value = '<?php echo $line; ?>' ;