CodeIgniter Forums
Formatted text - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Formatted text (/showthread.php?tid=15589)



Formatted text - El Forum - 02-09-2009

[eluser]Iverson[/eluser]
I usually use RTE(Rich Text Editor) to store fields in my database like articles, etc. However, I ALWAYS run into the problem of editing the info. Javascript doesn't like newlines and I've tried everything I can think of to mitigate this problem. Nl2br doesn't work, str_replace isn't working, eregi functions don't work either. Any suggestions on allowing a user to to submit this type of data and then allow them to edit it?


Formatted text - El Forum - 02-09-2009

[eluser]simshaun[/eluser]
If you happen to be using FCKEditor, it comes with a PHP lib that you could integrate.
You create an object, do $rte->Value = $blockFromDb, and then do something like $rte->Create(). It will take care of all the JS mess for you.