0
Good night,
I have a system to control incoming and outgoing computer repairs what I want and when I store the information in the database soon after I gave it to print the html content of a div where the stored data will be.
In this case I want to be saved successfully 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>
Hello, you already have the option created to print content?
– Tiago Gomes
That’s not what I’d like to do
– César Sousa
What do you mean by printing? Popular fields? Send to printer?
– Tiago Gomes
Barely serious if saved successfully print the fields I will put in an html
– César Sousa
Already have this html done? if yes insert in the question with the information you want to popular these fields. You will also need to get a response from the JSON server (at least that’s how I would do it).
– Tiago Gomes
I don’t have the html yet so I need to know how to print after the javascript done open the option to print this html that will be in a div
– César Sousa
OK. I tried to simplify the process. If you continue to have questions ask me to change the answer.
– Tiago Gomes