Results 1 to 3 of 3

Thread: Rich Text Editor Line Break Difficulties

  1. #1
    Join Date
    Oct 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Rich Text Editor Line Break Difficulties

    1) Script Title: Rich Text Editor (for textareas)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...richtexteditor

    3) Describe problem: I am using the Rich Text Editor that was created in the article linked to above. I have it set up where it submits the data entered into the text box to a specified database, which works fine. I am able to call the information from the database and place the text that was previously submitted back into the text box, if the page is refreshed. However, my problem is this: if any line breaks are submitted to the database, once they are re-displayed in the text box, the entire text box disappears. Getting rid of line breaks in the database allows the text to display properly in the text box, but keeping line breaks in the database entry will make the text box not appear. Line breaks are replaced with <br> tags when writing text in the text editor, but that is not the problem. The problem is that, when an HTML code is added, there is a line break after the HTML tag and this line break obviously does not have a <br> to replace it. So, any line break in the entry will not appear correctly in the text box when the submitted text is displayed in the rich text editor. Can anyone help me with this? If you need more information, I will happily provide it for you.

  2. #2
    Join Date
    Oct 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hm, I'm surprised that no one else has ever had this problem. Is more explanation needed so that my question can be understood? Because I can explain it more, if needed.

  3. #3
    Join Date
    Dec 2008
    Posts
    48
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Default

    add

    $text = str_replace(array("\n", "\r"), array('\n', '\r'), $strthatcomesfromdb);

    before the writeRichText function

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •