Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Old 03-18-2005, 12:39 PM Printing
Experienced Talker

Posts: 36
Trades: 0
How do you print an HTML form? I've used the onClick command from Javascript but it prints the button also! How can I print just the form?
common_sense is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-18-2005, 12:54 PM
drewrockshard's Avatar
Super Talker

Posts: 100
Name: Drew
Location: Garland (Dallas), Texas
Trades: 0
well you could use css...

you could call a separate stylesheet and create new css rules for the same elements in your document. When the user presses the print button the "print" styles in the separate stylesheet are called.

ill give you an example. you have to a stylesheet called "main.css" and you call it like so:
HTML Code:
<link href="main.css" type="text/css" rel="stylesheet" media="screen" />
maybe in this stylesheet you have a few styles that make the form borders green and the labels blue and the form button could be white with blue text.

Then you would create a separate styleshhet (there is a way to call it in the same stylesheet - i think it is @print...but dont worry about that now, just go with this example first)...so here is the call to the new style sheet that we will call "print.css"...
HTML Code:
<link href="print.css" type="text/css" rel="stylesheet" media="print" />
ok so in the stylesheet we take the same elements you styled in the previous styleshhet and either display them as "none", or you make them "print style", in which i mean, black and white. So that when they print on a printer, you can read it.

most poeple just take the print styles and make everything display as "none" (display:none; ) for all the elements that they dont want displayed and then make the text and links and such black and white optimized for printers, because not everyone has a color printer.

Hope this helps.
__________________
Best Regards,
Drew Decker

Please login or register to view this content. Registration is FREE
drewrockshard is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Printing
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.22199 seconds with 12 queries