Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Pop Up Window with Contents of Div

Posted on 2013-12-11
4
Medium Priority
?
410 Views
Last Modified: 2013-12-11
I'd like to know the best way to be able to click a button called print that will pop up a new window with the contents of a div on the current page to be printed.
0
Comment
Question by:Nathan Riley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 2000 total points
ID: 39712149
You don't really need a new window.  Just use an @media print in the stylesheet

@media print
  {
     style rules here
  }

Then set everything you don't want to print to display:none, and apply any special style you need to the div for optimum printing.

for the button you just need onclick="window.print();"

Cd&
0
 
LVL 12

Author Comment

by:Nathan Riley
ID: 39712524
For this solution I need to have it open in a new window.
0
 
LVL 12

Author Comment

by:Nathan Riley
ID: 39712528
Nevermind, I see what you mean now, it opens it into a print view anyways almost like a popup window.
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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question