For a reason that is unknown to me, my form is not submitting the text typed into my <textarea>
.
ajax code:
$.ajax({
type:'POST',
url:'****.php',
data:$('#blogForm').serialize(),
success: function(responseSubmit) { blah blah etc...
The inputs work just fine, and correctly post to my database.
The form is:
<form id="blogForm">
<input type="date" name="date" id="blogDate">
<input type="text" name="title" id="blogTitle">
<textarea name="blogContent" id="blogBody"></textarea>
<input type="submit" name="submit" id="blogSubmit">
</form>
And what I get when I inspect in firebug, the POST is:
date=09%2F25%2F1986&title=Title&blogContent=
As you can see, the blogContent is empty. Why is this?
I neglected to mention that I had a WYSIWYG editor attached to the text area, called nicEditor. Apparently there is a bug that forced jQuery to not serialize the textarea. Once the nicEditor was removed, it worked fine. Thanks for all the help.
Change:
data:$('#blogForm').serialize(),
To:
data:$('#blogForm').find('input, select, textarea, button').serialize(),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With