print selected text in a html page

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Dec 2008
Posts: 6
Reputation: farshidk is an unknown quantity at this point 
Solved Threads: 0
farshidk farshidk is offline Offline
Newbie Poster

print selected text in a html page

 
0
  #1
Dec 13th, 2008
Hi; how can a predefined text be printed in a html page? it means, when the "print this page" button/link is clicked all the elements in the window is printed even the button.
now is there any way to print just the texts & etc. without printing the buttons and unuseful elemets?
appreciating your replies.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 7
Reputation: daulex is an unknown quantity at this point 
Solved Threads: 1
daulex's Avatar
daulex daulex is offline Offline
Newbie Poster

Re: print selected text in a html page

 
0
  #2
Dec 13th, 2008
What you will need is a separate stylesheet for your printing layout.
To insert it, put this into your head:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <link rel="stylesheet" type="text/css" href="/css/print.css" media="print" />
then in the stylesheet simply put: display:none; for each of the elements that you don't want to display.
Done.
Hi! My name is Kirill Galenko. I am a freelance web designer. I am currently spending a lot of time working on the devesto project.
I live in London(UK) and am currently available for hire.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 6
Reputation: farshidk is an unknown quantity at this point 
Solved Threads: 0
farshidk farshidk is offline Offline
Newbie Poster

Re: print selected text in a html page

 
0
  #3
Dec 14th, 2008
Originally Posted by daulex View Post
What you will need is a separate stylesheet for your printing layout.
To insert it, put this into your head:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <link rel="stylesheet" type="text/css" href="/css/print.css" media="print" />
then in the stylesheet simply put: display:none; for each of the elements that you don't want to display.
Done.
Hi...

thank you, that's exactly what i was looking for!
regards
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 1665 | Replies: 2
Thread Tools Search this Thread



Tag cloud for JavaScript / DHTML / AJAX
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC