I have a text box that can allow the users to hit enter. When they hit enter I check the input and replace the carriage return with \n
. However it still sends to my db a carriage return.
What could be wrong?
Here is the code:
var pp = comment.value;
alert(pp.replace(/\r?\n|\r/g, "\n"));
comment.value = pp.replace(/\r?\n|\r/g, "\n");
and in my db I still get carriage return character even though I am replacing it.