datatable does not support "\ r \ n" or remove line breaks in textarea

0

DATATABLE 10.11.16 does not work if a text field has "\r\n" line breaks says jason error

$('#myTable').DataTable( {
    ajax: {
        url: '/api/Listar_notas.php',

    },
    columns: [ ... ]
} );

open some solution for this.

Or the other thing that occurs to me is to remove the blank spaces that are about to enter the database.

I tried doing this but it still follows me entering line breaks. I want everything to be in one line if I do this

$campo_obs = str_replace("\r\n","<br>",$textarea);

Open some configuration for datatable or you could help me remove the line breaks for a single line

    
asked by Carlos 13.02.2018 в 03:21
source

1 answer

0

Try it this way:

$campo_obs = str_replace("\r\n"," ",$textarea);

This way you will be left in a single line since the <br> tag is the one that is entering the line break.

    
answered by 13.02.2018 в 03:37