|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
Print a different page than current page?
I have an html page describing an event we will be holding, "description.html". I have a Word document (which I can convert to PDF or html format) which is the registration form for the event.
I would like to create a link at the bottom of "description.html" that says, "Click here to print the registration form." I want the viewer to be able to click on the link and have the registration form automatically go to the printer, without having to open it first. I found a javascript that will print a different page than the current page, but only if you go to FILE, PRINT in the browser. I would really like to do it with a link or a button. I was told you can accomplish this with the use of framesets, but I couldn't get it to work right. Can anyone help? |
|
#2
|
|||||
|
|||||
|
Re: Print a different page than current page?
u want it to go strait to the printer?
I know that if u put a link on description.html to the form ure placing there as well it will ask u to save or open it. from either or both u can then open and print the page as for making it go straight to the printer i'm not sure maybe IM brandon and maybe he can assist |
|
#3
|
|||||
|
|||||
|
Re: Print a different page than current page?
You want this button to automatically send the page to the printer without loading on the screen? As far as I know, that's not possible. And I wouldn't really recommend it if it is. It's nice to see what you're printing before-hand to see what it is, how long it is, etc. I'd either go with a PDF or an HTML file for an online doc. I'm a bit opposed to using the MS Word format on a website since not everyone has Word and the formating of the page is more like to be off than with HTML or a PDF.
|
|
#4
|
|||
|
|||
|
Re: Print a different page than current page?
I found this at HtmlGoodies.
It doesn't do exactly what you want, but it does show an onload command that might work for you. Quote:
|
|
#5
|
|||||
|
|||||
|
Re: Print a different page than current page?
Thanks for your suggestions. I agree about the Word document; we normally do not post docs in that format.
|
|
#6
|
||||
|
||||
|
Re: Print a different page than current page?
Will this help you at all?
http://www.dynamicdrive.com/dynamici...printstyle.htm |
|
#7
|
|||||
|
|||||
|
Re: Print a different page than current page?
I figured out how to do it.
In the current document, in the HEAD tag, type the following code (where href= refers to the different page you want to print without loading to the screen first): <link rel="alternate" media="print" href="different_page.html" /> <script> function printWindow(){ bV = parseInt(navigator.appVersion) if (bV >= 4) window.print() } </script> and then in the BODY of the current document type: <a href="javascript rintWindow()">Print The Different Page</a>(I wanted a link to print and not a print button). I know this won't work for every browser, but it will work for my purposes. Thanks to everyone who replied with suggestions! |
|
#8
|
|||||
|
|||||
|
Re: Print a different page than current page?
LOL, OK, I have no idea how to get that smiley face outta the code! But you can figure out what I meant!
|
|
#9
|
|||
|
|||
|
Re: Print a different page than current page?
Quote:
if you want to add another line in your code you can have it so theres a link to the page you want printed if the browser doesnt support it. it being this: Code:
<link rel="alternate" media="print" href="different_page.html" />
<script type="text/javascript">
function printWindow(){
bV = parseInt(navigator.appVersion)
if (bV >= 4) {
window.print()
}
else {
window.location="different_page.html";
}
</script>
<a href="javascript:printWindow()">Print The Different Page</a>
|
|
#10
|
|||||
|
|||||
|
Re: Print a different page than current page?
I think that this should work, but I haven't tested it:
Code:
<a onClick="window.print(http://www.domain.com/pagetoprint.html)"> |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A question about current.... | Adam Y. | Electrical | 41 | 26-11-2004 21:46 |
| Current Sensor | Joshua May | Programming | 6 | 12-02-2004 10:48 |
| using a current sensor to "brake" a motor | Max Lobovsky | Control System | 4 | 10-02-2004 22:51 |
| Current Monitoring system questions | PyroPhin | Technical Discussion | 44 | 17-02-2003 15:34 |
| What happens / why do motors stall? | DanL | Technical Discussion | 19 | 21-11-2002 07:19 |