Hi,
I've read your clear FAQ about how to add a print button and it works.
But I would like to ask you if its' possible to automatically print after a submit button:
scenario:
user fills a form;
he lands in a page where he can check all entries;
he can submit the form;
from here should print automatically a new formatted custom code (on submit), without land in a new page with print button and the print.
Possible
THanks
Matteo
I've read your clear FAQ about how to add a print button and it works.
But I would like to ask you if its' possible to automatically print after a submit button:
scenario:
user fills a form;
he lands in a page where he can check all entries;
he can submit the form;
from here should print automatically a new formatted custom code (on submit), without land in a new page with print button and the print.
Possible
THanks
Matteo
Hi Vismay,
I don't know if that is possible :-( Have you found anything that shows how to do it from JavaScript?
Bob
I don't know if that is possible :-( Have you found anything that shows how to do it from JavaScript?
Bob
Alternative is to submit the form and the guest will receive a mail with the confirmation and the result as attachment, better in .pdf, then he can print it by himself.
Basically with this function:
I let print this result:
Ho can I attach this html/PHP page to an email? Better in .pdf?
Thanks!!!!!
Matteo
Basically with this function:
<?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=900, 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);
?>
I let print this result:
<div id='print_div'>
"HTML/PHP page"
</div>
<input type="button" value="Print" id='print_button' style='visibility: hidden;'></input>
Ho can I attach this html/PHP page to an email? Better in .pdf?
Thanks!!!!!
Matteo
Hi vismay,
You can create a PDF from your form results, Max has a beta version of a TCPDF action for ChronoForms that will do this. It takes a little work to format the PDF but works OK.
Then I think this FAQ has a method for attaching the file. If not then please ask back here.
Bob
You can create a PDF from your form results, Max has a beta version of a TCPDF action for ChronoForms that will do this. It takes a little work to format the PDF but works OK.
Then I think this FAQ has a method for attaching the file. If not then please ask back here.
Bob
Tranks, i've asked Max via contatta form about it.
If I chiose the www to attach the created HTML to the email Renault, how can I save it to the server?
Matteo
If I chiose the www to attach the created HTML to the email Renault, how can I save it to the server?
Matteo
sorry, some type error!!!
I've got the tcpdf from max, I mannage to save nad print the pdf, but after this action doesn't go further to email action, it just stop there without submission, even if I put the email action before tcpdf.
Any Idea?
Matteo
I've got the tcpdf from max, I mannage to save nad print the pdf, but after this action doesn't go further to email action, it just stop there without submission, even if I put the email action before tcpdf.
Any Idea?
Matteo
This topic is locked and no more replies can be posted.