[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 528
  • Last Modified:

how to change the visibility of a td so to print or not print it

I print 2 copies of my webpage using javascript.
In between the 2 statements I need to swap visibilty of 2 td's so I can display the text differently in the 2 print.The following code doesnt seem to help. thank
<script type="text/javascript">
    function Print() {
       window.print();


       var tblStore = document.getElementById("<%= tblDash.ClientID %>");
       tblStore.style.display = 'none';

       var tblCustomer = document.getElementById("<%= tblCustomerCopy.ClientID %>");
       tblCustomer.style.display = 'block';

       window.print();
       var clickButton = document.getElementById("<%= lnkHome.ClientID %>");
        clickButton.click();
    }
    </script>
0
TrialUser
Asked:
TrialUser
3 Solutions
 
Michel PlungjanIT ExpertCommented:
The printing is busy when you try to print the second time

try copying the stuff to a new window for second print
0
 
Roopesh ReddyCommented:
Hi,

You can try onbeforeprint event!

http://www.javascriptkit.com/javatutors/ie5print.shtml

NOTE: It works only in IE, Firefox and may be safari!

Hope it helps u...
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now