...

View Full Version : Print a the data on a specific frame only?



killerpm
12-09-2004, 03:47 PM
hi

This is my code


INDEX.HTML


<FRAMESET rows="145,*" border=0 frameborder="0">



<frame name="Top" src="top.htm" scrolling="no" >

<FRAMESET cols="150,*" border=0 frameborder="0">
<frame name="left" src="left.html" scrolling="no">
<FRAMESET rows="*,20" border=0 frameborder="0">
<frame name="display" src="display.html" scrolling="yes">
<frame name="down" src="down.html" scrolling="no">



</frameset>
</frameset>
</frameset>
</frameset>


i want to put a print button on display.html page
and i want when i click on it , to print only the display.html page
without printing the other frames
(of course i will click on it when am on the index.html)

so anybody have any idea about this move??

Bobo
12-09-2004, 05:04 PM
window.document.print()
OR
window.print(document)

killerpm
12-09-2004, 07:55 PM
Thanx a lot

but i also find a Continue to yr code ,

i will put it here ,so if anybody want to benefit from it



<head>

<SCRIPT LANGUAGE="JavaScript">
function myprint() {
window.parent.display.focus();
window.print();
}
</script>

</head>

<body>

<input type=image src='printer.jpg' onClick="myprint()">

</body>




if u want to use it u have to change window.parent.display.focus(); to the your frame page name , u want to print it

and also , if u dont have an img called printer.jpg

u can make it as a button

<input type=button value="Click To Print" src='printer.jpg' onClick="myprint()">



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum