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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Print page button

Status
Not open for further replies.

chrismassey

Programmer
Aug 24, 2007
264
GB
Hello,

I have a section of javascript here:
<A HREF="javascript:contentframe.print()">Print Page</A>

Now this simply opens up the print dialog box, and will print the contents of the I-Frame "contentframe".

I am now no longer using frames across my website and instead using perl and php to display the contents of the contentframe inside a table cell instead.

This means that my javascript print button can no longer work because there is no frame. I cannot use "window" because this will print the entire page including the left links and the header banner.

My first solution was to display an iframe with a height and width of 0, although a tiny piece of the iframe is still visible in firefox.

Is there a way to adapt the javascript print code so that instead of choosing which frame it prints, to choose a URL it prints. E.g.

<A HREF="javascript: Page</A>

Thanks

Chris
 
Why not simply define a print style sheet which hides everything you don't want printed? It's a whole lot easier.

Ask in forum215 for more help on this if you need it.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Hey,

Thanks for the response Billy. That would be the perfect solution, however I am currently having problems with containing CSS .htm files within an online HTML Editor. Therefore all the pages are just standard HTML.

Here is a standard HTML Example:

Here is a CSS HTML Example:

Note that the CSS isn't contained within the Editor like the standard HTML is.

Its alright though, its not a biggy :)

Thanks,

Chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top