Editor ignoring newlines (\n) in textareas

Editor ignoring newlines (\n) in textareas

NettSiteNettSite Posts: 36Questions: 11Answers: 2

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: 15,240Questions: 1Answers: 2,599
    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: 36Questions: 11Answers: 2
    edited October 2018

    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: 36Questions: 11Answers: 2

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

This discussion has been closed.