Editor ignoring newlines (\n) in textareas

Editor ignoring newlines (\n) in textareas

NettSiteNettSite Posts: 21Questions: 7Answers: 1

Hi,

I have three textarea fields on a form, and in each case newline characters ("\n" or "\l\n") are displayed in the text instead of causing a new line.

I have also noticed that while I can edit the text in the textarea, typing [Enter] has no effect.

I have Datatables 1.10.18 and Editor 1.7.4 and I am using Chrome.

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 2,381Questions: 0Answers: 427
    Answer ✓

    Hi @NettSite ,

    I believe the newline was address in the 1.8 release, see this thread here. Would you be able to upgrade and see if it resolves the issue for you, please?

    Cheers,

    Colin

  • NettSiteNettSite Posts: 21Questions: 7Answers: 1
    edited October 11

    Hi Colin,

    Thank you! That has resolved the enter key problem, I now only need to figure out the issue with new line characters being displayed as text, instead of new lines.

    The data is in an array on the server, and I "implode" it in PHP:

    foreach ($occupation->tasks as $task) { 
       $tasks[] = $task['task'];  
    }  
    return implode('\r\n', $tasks);
    
  • NettSiteNettSite Posts: 21Questions: 7Answers: 1

    Solved! Replaced "\r\n" with "chr(10)" in my server side code. Beaut!

Sign In or Register to comment.