I am trying to create a simple Javascript text editor that only makes paragraph breaks to entered paragraphs inside textarea input. while saving textarea input value in database they strip out the paragraph breaks and I also don't want to use all other present text editors because I only need the paragraph breaking (br tag) to be placed while hit enter key and should be saved like that with the tag inside the database. I could not find the solution by Googling.
-
Are you in control of the backend?Ian Hunter– Ian Hunter2012-04-04 03:08:17 +00:00Commented Apr 4, 2012 at 3:08
-
yes, actually i want the text editor to be in the backend.monk– monk2012-04-04 03:15:17 +00:00Commented Apr 4, 2012 at 3:15
-
I mean, do you have access to the code that saves the data in the database?Ian Hunter– Ian Hunter2012-04-04 03:19:39 +00:00Commented Apr 4, 2012 at 3:19
-
Yes. its my own page. I am developing it. I want my backend to be friendly to me.monk– monk2012-04-04 03:23:13 +00:00Commented Apr 4, 2012 at 3:23
Add a comment
|
2 Answers
Depending on your needs, you may consider using something to replace newlines with <br> tags on the server side rather than trying to insert the tags in the textarea itself. PHP has the nl2br function for example.