Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing a dynamically generated HTML

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
hi,

i have the following code:
------------------------------------------------------------<html>
<head>
<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
<!--
function f1()
{
document.writeln(&quot;<html>&quot;);
document.writeln(&quot;<body>&quot;);
document.writeln(&quot;<h1>Page to be printed</h1>&quot;);
document.writeln('<form name=&quot;frm1&quot;><input type=&quot;button&quot; name=&quot;btn2&quot; onClick=&quot;window.print();&quot;></form>');
document.writeln('</body>');
document.writeln('</html>');
}
//-->
</SCRIPT>
</head>
<body>
<h1> Click on the button</h1>
<form name=&quot;frm1&quot;>
<input type=&quot;button&quot; name=&quot;btn1&quot; onClick=&quot;f1();&quot;>
</form>
</body>
</html>
------------------------------------------------------------My intension is to print the dynamically generated page (i.e. the page having the message 'Page to be printed') when button 'btn2' is clicked but i am getting the printed page containing the message 'Click on the button'

i want the code to behave same in Netscape Navigator also.
please help me,

regards,
Nishant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top