I have a problem and as simple as it seems I can not understand and consequently, it solves it, my call to the page has changed and now it is like this:
$(function() { $('#frmCadastro').validate({ rules: { Nome: { required: true }, Cpf: { required: true }, Data: { required: true }, }, // Messages for form validation messages: { Nome: { required: '' }, Cpf: { required: '' }, Data: { required: '' } }, submitHandler: function(form) { var data = $(form).serialize(); //event.preventDefault(); $.ajax({ url: "pImpreComDispTemporaria.php", type: 'POST', datatype: 'text', data: data, success: function(data) { console.log(data); var janela = window.open("", "", "width=800,height=1000"); janela.document.write(data); janela.focus(); janela.print(); } }); return false; } }); });
But the image at the top is never displayed, the page looks like this:
<body>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
<tr>
<td></td>
</tr>
<tr valign="center">
<td height="82" colspan="2" align="left">
<img src="../_imagens/logo-employer.gif" width="244" alt=""/>
</td>
</tr>
<tr>
<td></td>
</tr>
</table>
The image is in the correct directory and the call is correct, if cancel, closing the print window the header with the image is displayed correctly.