I have an textarea for user to input comment and a button to submit using jQuery .post() and JSON.
$('#submit').click(function () {
var comment = {};
comment.Author = $("#author").val();
comment.Email = $("#email").val();
comment.WebSite = $("#url").val();
comment.Body = $("#comment").val(); // textarea
$.post('/ajax/comments', comment, parseComment, 'json');
But, $("#comment").val() doese not seem to preserve newlines so how do I get this to work?
Edit: the input is losing newlines.