CodeIgniter Forums

Full Version: Formatted text
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[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?

El Forum

[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.