Printing a Form with jQuery
<p>All,
I've got the following HTML/PHP on my page:</p>

<pre><code>if(isset($_GET['user_id']) &amp;&amp; $_SESSION['role']=="admin"){
$user_id = $_GET['user_id'];
}else{
$user_id = $_SESSION['user_id'];
}
?&gt;
&lt;button id="print_timeline" value="&lt;?php echo $user_id; ?&gt;"&gt;Print Timeline&lt;/button&gt;
</code></pre>

<p>When I click the button I've got the following jQuery:</p>

<pre><code>jQuery("#print_timeline").click(function(event){
    var user_id = jQuery(this).val();
    window.location.href = site_url + 'print.php/?user_id=' + user_id;
});
</code></pre>

<p>I'm trying to get print the print.php page without leaving my current page and just have the printer properties open to print my print.php page. On my print.page I've got the following code to print it automatically:</p>

<pre><code>&lt;body onload="window.print()"&gt;
</code></pre>

<p>Any idea how I can achieve this?</p>

<p>Thanks!</p>
