Hi,
Apologies up front for not setting up a jsfiddle for this, but I
couldn't figure out how to dump the results of an AJAX form post in
jsfiddle.
Anyway, I've got a simple form, like this:
<form action="post.cfm" method="post" id="myform">
<input type="text" name="subject" value="" />
<textarea name="body"></textarea>
<button type="submit">Submit</button>
</form>
If I type in some data with carriage returns, post the data normally,
then look at the character codes for each characters, I'll see 13 10
for any returns, which is what I'd expect.
However, if I submit the identical data using Form.Request in Safari
(Snow Leopard *and* Windows 7), Chrome and Firefox, like this:
<div id="return"></div>
var formsubmit = new Form.Request (
$('myform'),
$('return')
)
...and then look at the character codes, all the "13" codes are just
gone, so all I see are "10"s for line breaks. Obviously, this screws
things up.
I've never seen this before, and I've certainly used Form.Request in
the past, so I'm sort of beating my head against a wall. I've tested
this both on my laptop (Windows 7, IIS 7, ColdFusion 9), and our
production box (Windows Server 2003, IIS6, ColdFusion 8), and get the
same results.
Any ideas/suggestions much appreciated.