Hi Bob,
Sorry to bother you again, but I don't get it :/
So, this is what i done:
In Event OnLoad i only set the ShowHtml action.
In Event OnSubmit i set:
-Show thanks Message action with this code:
-
<div id='print_div'>
<p>É este </p>
<table cellpadding="5" cellspacing="5" border="0">
<tr>
<td>
<strong></strong>
</td>
<td>
{}
</td>
</tr>
<tr>
<td colspan='2'>
<label id="qtdLoja">Quantidade</loja>
</td>
</tr>
<tr>
<td>
<strong>2008 Vale de Pios</strong>
</td>
<td>
{insP1}
</td>
</tr>
<tr>
<td>
<strong>2007 Pios</strong>
</td>
<td>
{insP2}
</td>
</tr>
<tr>
<td>
<strong>2008 Excomungado</strong>
</td>
<td>
{insP3}
</td>
</tr>
<tr>
<td>
<strong>Azeite Virgem Extra 1/2L</strong>
</td>
<td>
{insP4}
</td>
</tr>
<tr>
<td>
<strong>Azeite Virgem Extra 5L</strong>
</td>
<td>
{insP5}
</td>
</tr>
<tr>
<td>
<strong></strong>
</td>
<td>
{}
</td>
</tr>
<tr>
<td>
<strong>Nome</strong>
</td>
<td>
{insNome}
</td>
</tr>
<tr>
<td>
<strong>Endereço Factura</strong>
</td>
<td>
{insEnderecoFactura}
</td>
</tr>
<tr>
<td>
<strong>Telefone</strong>
</td>
<td>
{insTelefone}
</td>
</tr>
<tr>
<td>
<strong>Endereço Entrega</strong>
</td>
<td>
{insEnderecoEntrega}
</td>
</tr>
<tr>
<td>
<strong>Email</strong>
</td>
<td>
{insEmail}
</td>
</tr>
<tr>
<td>
<strong></strong>
</td>
<td>
{}
</td>
</tr>
</table>
</div>
<input type="button" value="Print" id='print_button' style='visibility: hidden;'>
- Custom Code with this code:
-<?php
$doc =& JFactory::getDocument();
$script = "
function printPage()
{
var html, css, csss_file, printWin;
css = \"\";
css = \"<style type='text/css'>\"+css+\"</style>\";
css_url = '';
if ( css_url !== '' ) {
css_url = \"<link rel='stylesheet' type='text/css' href='\"+css_url+\"' media='print' />\";
}
html = '<html><head>'+css+css_url+'</head>'+$(id).innerHTML+'</html>';
printWin = window.open('', '', 'left=100, top=100, width=600, height=400, toolbar=0, scrollbars=0, status=0' );
printWin.document.write(html);
printWin.document.close();
printWin.focus();
printWin.print();
printWin.close();
}
var id;
window.addEvent('domready', function() {
id = 'print_div';
$('print_button').setStyle('visibility', 'visible');
$('print_button').addEvent('click', printPage);
});
";
$doc->addScriptDeclaration($script);
?>
But the button dont show up, and if i let it be visible it don't work :s
Can U say what i'm doing wrong?
I want to put this on load, but first i want to understand how it works.
Thank you for your attention and patience!
Greetings
BN