Hello, good evening, I need your help, I want to automatically save what is typed in a text area in my mysql database, I've heard that it has to do with Ajax, I tried with this code I have there, but is not working, data is not being saved.
<script>
setInterval(function() {
$.ajax({
url: 'http://www.dpaulatreinamentos.com/system/teste03/views/pages/pegaIdLousa_edit.php?id_aula=<?php echo $id_aula; ?>',
type: 'post',
data: {
'Lousa': $('#editor5').val()
},
success: function() {
}
});
}, 5000 /* 1000 = 1 segundo, aí o tempo você quem determina */);
</script>
Part of the Form
<form method="post" action="http://www.dpaulatreinamentos.com/system/teste03/controllers/edit_lousas.php?id_aula=<?php echo $id_aula; ?>">
<textarea name="Lousa" id="editor5" rows="20" cols="10">
<?php echo $select_lousa; ?>
</textarea>
<script>
// Replace the <textarea id="editor1"> with a CKEditor
// instance, using default configuration.
CKEDITOR.replace( 'editor5' );
</script>
<input type="submit" value=" Salvar " class="btn-save-medium" />
</form>