1
Hello, good night, I need a help from you, I want to automatically save what is typed in a text area in my mysql database, I’ve heard that has how to do with Ajax, I tried with this code I have there, but it’s not working, the 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 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>
Not saving or not sending the data to the server? If the data goes but does not save, put the code that makes the insertion in the database.
– Ricardo Moraleida
If I click the button the data saves normally, plus if I just enter the data does not send, only stay on the screen even more in the database nothing happens
– William De Paula
someone knows how to?
– William De Paula
It would be more feasible to store this data when typing in the browser’s localStorage. Only with the click would they be inserted into the database.
– Maurivan
That no longer solves my problem, is a digital whiteboard system, where I will have the first instance with the teacher typing and in real time being sent to the server and at the same time the student accessing the viewing part of this whiteboard, what really can’t is having the click understand
– William De Paula
I already ran the tests on my server and I will have a delay of 3 seconds until everything happens, I think enough for the class to happen, more needed this part first
– William De Paula