Good evening,
I have a system of control of inputs and outputs of computer repairs what I intend and that when I save the information in the database soon after I gave myself to print the html content of a div where the stored data will be recorded.
In this case, I want it to be saved successfully and open the option to print the contents of the div.
<script>
$(document).on("click", "#novo", function(e) {
tinyMCE.triggerSave();
var postData = $("#form_novo").serialize();
var cliente = $("#cliente").val();
var avaria = $("#avaria").val();
if(cliente === '' || avaria === ''){
toastr.error('Preencha os campos obrigatórios!', 'Campos');
}else{
e.preventDefault();
$.ajax({
type: "POST",
url: "modulos/reparacoes/guardar.php",
data: postData,
cache: true
}).done(function(msg) {
toastr.success('Dados guardados com sucesso!', 'Reparações');
}).fail(function(data) {
toastr.error('Ocorreu um erro!', 'Erro');
});
}
});
</script>