i have a form that contains text, html, and carriage returns in a textarea. when i try to submit this form using javascript (using ajax) it won't submit properly because the html and carriage returns mess up the js variables. for example....
function submitForm() {
var t = document.getElementById('myText').value;
... [ajax content here].....
}
and in the body....
<textarea id="myText">This is the text I want sent via javascript.
But things like the carriage returns and links like this <a href="http://www.whatever.com">link</a> are messing things up.</textarea>
however, if i create a form tag, and submit the form the old fashioned way... it works just fine.
how can i submit a form using javascript in the same manner the form tag does?
oh yea, my form tag and ajax are using the post method.



Reply With Quote

Bookmarks