Forums

Print On Submit display

woro 22 Dec, 2008
In the "on-submit-code", which is after sending displaed, I put the email-template. So the sender could see, what was submitted.
A nice and useful feature should be, to print out this display.
With Javascript it works, but then whole screen is printed out. That's not, what I want.
Is there any clue to embed the Joomla-Print-Button?
Thanks
Wolfgang
GreyHead 22 Dec, 2008
Hi Wolfgang,

What the print button does is to display a page with index2.php in the url. Including the print button is easy enough, the problem is to create a page for it to display. I'm sure it possible to do without re-submitting the form but just at the moment I can't work it out :-( Maybe tomorrow.

Bob
Max_admin 23 Dec, 2008
Hi, you can save the data in a DB record then get it back wit ha ChronoConnectivity connection and use the index2.php version!🙂

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
woro 23 Dec, 2008
Thank you very much for the quick answers!
Till now I didn't use your ChronoConnectivity. With your answer I read first the features of this component and I will try it. Because I can imagine a lot of other opportunities to use this component eg display members of a club etc.
To use this componet for printing the submitted data, I assume I have to use the redirect URl after submitting the form to the ChronoComponent, which displays this data.

Regards and merry christmas
Wolfgang
Max_admin 23 Dec, 2008
Hi WG,

once you created the connection you get the URL for it and can use it in whatever way to show it!

Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
northie 24 Mar, 2009
I've found an alternative method for printing just the "results" page after a submit. It's done by adding some CSS code and some JavaScript code in the "Form Code" --> "onSubmit Code after sending Email". Briefly, the CSS code defines some "print media" rules and the JavaScript assigns the CSS rule to sections of the template which I don't want printed.

The CSS rule added to the "On Submit code - after sending email" is:
<style type="text/css">
	@media print {
	  .DONTPrint	{ display:none }
	}
</style>

The JavaScript code requires that you know the IDs of the DIVs you don't want to show on the print out. Here's an example which would also be added to the "On Submit code - after sending email" section:
<script type="text/javascript">
	function hide_for_print() {
		// These prevent unwanted items from printing when the user clicks the Print button
		document.getElementById('header').className = 'DONTPrint';
		document.getElementById('horiz-menu').className = 'DONTPrint';
		document.getElementById('footer').className = 'DONTPrint';
	};
	
	window.onload = hide_for_print;
	
</script>

In this example, you would have to know that your template has DIVs with IDs of 'header', 'horiz-menu' and 'footer'. The "window.onload" is needed to ensure all portions of your page are loaded before setting the className.
Max_admin 25 Mar, 2009
Thanks for sharing!🙂

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.