Page 1 of 1

multiple lines, Database

Posted: Thu Jan 14, 2016 7:26 am
by Nicklas

Hello!
I trying to find out how i make multiple lines in the database.
Example: I have a textarea in my app where the user push ENTER to make a new line and then write something in the new line to. But when the text in the textarea goes up to the database, everything goes over to be in one line.
Is it possible to make it be in multiple lines in the DB to?


multiple lines, Database

Posted: Thu Jan 14, 2016 2:31 pm
by Nicklas

Dont know if you understood it but im talking about linebreak in db :)


multiple lines, Database

Posted: Fri Jan 15, 2016 7:57 am
by Evgene Karachevtsev

Hello Nicklas,

Please clarify what user wants to achieve doing this? At first sight, there could be several ways. The easiest

1) To set the handler for ENTER keydown
2) At keydown set the line in textarea to some storage key
prewindow.localStorage.setItem('last_line', textarea_text);/pre
3) Post this tot db
4) Then when the user enters second line - slice from the whole string that part
you saved in storage
prevar textareaText = Appery("#textarea").val();
var lastLine = window.localStorage.getItem('lastline');
if (lastLine !== undefined) {
var string_to_post = textareaText.slice(lastLine.length);
}/pre
5) Save new string to storage
prewindow.localStorage.setItem('last_line', string_to_post);/pre
6) Then post again

and so on...