Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 11th, 2005, 09:06 PM
Authorized User
 
Join Date: Oct 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kiwibey
Default How to use Print Hidden Function

hi all,
good morning,
i have facing problem to use printhidden function in javascript.
i want my system allow me to print few of the pages by just click once print button. do you think is it possible ?
below is my code,
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 1</title>
</head>

<body>
<script type="text/javascript">
function printURL()
{
   window.onprintcomplete = function() // set to handle completion
   {
   }
   printHidden("testing.asp");
   printHidden("testing1.asp");

}

</script>

Testing Print Hidden In Java Script

<form>
<input type="button" onclick="printURL()" value="Call function" >
</form>
</body>

</html>

* please help me have a look and share your knowledge with me :)
i'll very thankful to receive your reply..
have a nice day

bey


 
Old May 12th, 2005, 01:03 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

And where is the printHidden function defined?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old May 12th, 2005, 01:30 AM
Authorized User
 
Join Date: Oct 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kiwibey
Default

hi imar,
thank for your reply.
actually i not really know how to use the printhidden function.
so can you give me the idea to make the printhidden function can be run.
thanks a lots :)

bey

 
Old May 12th, 2005, 02:40 AM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 186
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hi,

I have not seen any "printhidden" in javascript.
It seems that, its a custom funtion.

As Imar said find the funtion code.

Prashant

 
Old May 12th, 2005, 04:56 AM
Authorized User
 
Join Date: Oct 2004
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to kiwibey
Default

hi prashant & imar,
i get this code from my friend, so i not so sure about it....
anyway, thank you very much.

bey


 
Old May 12th, 2005, 09:00 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Quote:
quote:Originally posted by kiwibey
 i get this code from my friend


Well ask him about it :)
window does not have an event "onprintcomplete" either, there is "onafterprint".



--

Joe (Microsoft MVP - XML)
 
Old May 12th, 2005, 11:38 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You may want to try this:

http://Imar.Spaanjaars.Com/QuickDocId.aspx?QUICKDOC=243

It's an IE only solution, and it may not work due to security restrictions, but it's worth a try....

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript print function mii2029 ASP.NET 3.5 Basics 2 September 27th, 2008 12:56 PM
PRINT function kuku HTML Code Clinic 10 October 9th, 2006 07:02 AM
print the hidden page without the print dialog box kayzem Classic ASP Basics 0 April 21st, 2005 11:31 PM
Print preview "unhides" previously hidden objects amerk20 Excel VBA 1 February 22nd, 2005 03:47 AM
Print and print preview file on the website withou appleLover General .NET 0 February 19th, 2005 02:24 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.