Hi
I have a HTML form and on click of the submit button, I pull the values from the fields using javascript, frame them as parameters and use ajax to submit the form.
one of the fields is a textarea. If I use a new line character in the textarea, it is getting stored in the database without that ("\n\r").
from form, the value will be like "line 1 \n\r line 2"
but it is stored in the database as "line 1 line 2"
I tried to replace "\n\r" with "<br />" and store it. But the AJAX request fails if I do that.
what is the problem? any solution?
I have a HTML form and on click of the submit button, I pull the values from the fields using javascript, frame them as parameters and use ajax to submit the form.
one of the fields is a textarea. If I use a new line character in the textarea, it is getting stored in the database without that ("\n\r").
from form, the value will be like "line 1 \n\r line 2"
but it is stored in the database as "line 1 line 2"
I tried to replace "\n\r" with "<br />" and store it. But the AJAX request fails if I do that.
what is the problem? any solution?
Comment