Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# Java script
<script type="text/JavaScript">
     
     window.print()
     window.close()
 
   </script>
 
 <input type="button" value="Print"  önclick="this.style.visibility='hidden';window.print();" />
 
I am using this code webpage was printing but after printing i want to display old page it will contains buttons i.e print, save and Content
 
how it is displayed using java script code
 

Thanks &Regards
venky
Posted 6-Feb-12 2:01am
Edited 6-Feb-12 2:05am
v2
Comments
manognya kota at 6-Feb-12 7:05am
   
added <pre> tags.
Varun Sareen at 6-Feb-12 7:07am
   
Question not clear :(
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Do you just mean you want the 'print' button (that you hid in its event handler) to come back again? If so, you need to give it an id, and then do:
document.getElementById("print_button").style.visibility = '';
 
(Note: I usually use .style.display instead, but I think that makes little difference.)
 
Or if you want it to come back immediately after window.print() is called you can inline it in the event handler:
 
 <input type="button" value="Print"  önclick="this.style.visibility='hidden';window.print();this.style.visibility=''" />
 
However, this is all rather pointless since if you didn't provide the button at all, the user could just use the browser's Print button!
 
You can also use CSS to show/hide elements for printing, see for example this article[^].
  Permalink  
Comments
thatraja at 6-Feb-12 8:45am
   
Right, 5!
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 575
1 Kornfeld Eliyahu Peter 409
2 Maciej Los 369
3 DamithSL 196
4 OriginalGriff 188
0 OriginalGriff 6,353
1 DamithSL 4,854
2 Maciej Los 4,476
3 Kornfeld Eliyahu Peter 4,058
4 Sergey Alexandrovich Kryukov 3,917


Advertise | Privacy | Mobile
Web01 | 2.8.141223.1 | Last Updated 6 Feb 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100