Page 1 of 1

Javascript to print different page

Posted: Thu Oct 08, 2009 9:03 am
by rajsekar2u
Hi,

Am using the following two type of code to print different page.

Code: Select all

<link rel=alternate media=print href="index.html">
 
<input type="button" value="Print" onClick="window.print()" >
 

Code: Select all

<iframe width="50" name="toprint" src="index.html"></iframe>
 
<form name="test">
<input type="button" onclick="document.toprint.printThepage();" value="print index.html">
</form>
But both the above codes is working only in I.E 6.

And another problem in i.e 6 itself is it prints the file path in the bottom of the page.
How to hide that.

Re: Javascript to print different page

Posted: Tue Oct 13, 2009 11:36 pm
by jegan.aaodis
Hi,

Use this,

<FORM>
<INPUT TYPE="button" onClick="window.print()">
</FORM>
Or
<A HREF="javascript:window.print()">Click to Print This Page</A>

Thanks