I have a form that uses Ajax to do the POST in PHP and make the insertion in the database to get the data I use FormData however the textarea inserts empty in the bank.
<script type="text/javascript">
function submitForm() {
var myForm = document.getElementById('cadastro_anuncio');
var form = new FormData(myForm);
var plano = $("#plano").val();
if (plano != 1) {
$.ajax({
url: '<?php echo base_url('classificados/minhaconta/cadastrar_anuncio') ?>',
data: form,
type: 'post',
processData: false,
contentType: false,
success:
function (data) {
if (data == 0) {
location.reload();
}
else {
$("#code").val(data)
$("#comprar").submit();
}
}
});
return false;
}
}