Obtain database records of a text area [closed]

1

Hello friends I have a problem getting the data of a textarea , if I do not insert line breaks in the field the form gets them without problems (Modal Form) But if I insert line breaks at the time of registration, I no longer I opened the form, that is, the problem is getting the line breaks.

Does anyone know how to solve this problem?

I get the data as follows in javascript :

document.formname.textarea.value = textarea;
    
asked by Agustin Acosta 31.12.2015 в 16:17
source

1 answer

0

Your problem is caused by the line breaks when entering the value within TextArea , you can filter it or if you need it

text = text.replace(/\r?\n/g, '');
document.formname.textarea.value = text;

or change it to <br> :

text = text.replace(/\r?\n/g, '<br>');
document.formname.textarea.value = text;
    
answered by 11.02.2016 в 01:39