Tilted Forum Project Discussion Community  

Go Back   Tilted Forum Project Discussion Community > Interests > Tilted Technology


 
 
LinkBack Thread Tools
Old 10-21-2004, 08:16 AM   #1 (permalink)
Free Mars!
 
feelgood's Avatar
 
Location: I dunno, there's white people around me saying "eh" all the time
[html] Print script

I have 2 option of getting a particular webpage to be printed. 1 way is automatically and the other way is letting the user click on a button to print.

I don't want to use automaticallly since I want to let the user view the page before printing it.

So, I'm considering using the following script for manual print button

Code:
<SCRIPT LANGUAGE=JavaScript>

<!-- Begin
if (window.print) {
document.write('<form>Do not forget to '
+ '<input type=button name=print value="Print" '
+ 'onClick="javascript:window.print()"> this page!</form>');
}
// End -->
</script>
The question I have is that, will the print button show up on the printed page?

If not, is there a way for me to program a webpage using either html or jsp to print information from another page?
__________________
Looking out the window, that's an act of war. Staring at my shoes, that's an act of war. Committing an act of war? Oh you better believe that's an act of war

Last edited by feelgood; 10-21-2004 at 08:21 AM..
feelgood is offline  
Old 10-21-2004, 08:43 AM   #2 (permalink)
Crazy
 
Location: here and there
you could throw a dialog box to remind them to print the page.

function printPage() {
if (window.print) {
agree = confirm('This page contains really cool information that \nwe recommend you print a copy of at this time. \n\nOK to print now?');
if (agree) window.print();
}
}

you could then put a link to a printer friendly version of the page and onload execute the printPage() function.
theFez is offline  
Old 10-21-2004, 10:40 AM   #3 (permalink)
Crazy
 
Location: Salt Town, UT
You can also eliminate the print button using css.

In css, a little used feature is to have different stylesheets for different media types. So, for example, in the print media type, you could set the print button to not display. Simple, easy, and doesn't require any client-side (or server-side) scripting.
Rawb is offline  
Old 10-21-2004, 10:48 AM   #4 (permalink)
Psycho
 
noodles's Avatar
 
Location: sc
Quote:
Originally Posted by aoeuhtns
You can also eliminate the print button using css.

In css, a little used feature is to have different stylesheets for different media types. So, for example, in the print media type, you could set the print button to not display. Simple, easy, and doesn't require any client-side (or server-side) scripting.
this is what i would suggest. once the button is clicked make the element invisible. simple, easy solution.
noodles is offline  
Old 10-21-2004, 05:12 PM   #5 (permalink)
Crazy
 
Location: here and there
Quote:
Originally Posted by aoeuhtns
You can also eliminate the print button using css.

In css, a little used feature is to have different stylesheets for different media types. So, for example, in the print media type, you could set the print button to not display. Simple, easy, and doesn't require any client-side (or server-side) scripting.
any chance you could post some code to illustrate this? i've been learning css and have been very impressed with what can be accomplished.
theFez is offline  
 

Tags
html, print, script


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 On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 09:08 PM.

Tilted Forum Project

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54