Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem printing from a popup

Status
Not open for further replies.

bthale

Programmer
Oct 31, 2001
108
US
I have a popup window that has a print button

the link I use is <a href=&quot;javascript:print()&quot;>Print</a>

but it doesn't work. I have also tried <a href=&quot;javascript:window.print()&quot;>Print</a>

Anybody have a suggestion?

Using IE 6
 
Is it only failing to work in a popup window? As far as I know what you have should work and I don't know why the window being a popup should matter. Is it just doing nothing when you click it?

Kevin
A+, Network+, MCP
 
Yes, it does nothing and only fails inside the popup. The page is built inside a jsp and the popup windo is called with a function.

function printChart()
{
var pwin = window.open(&quot;print.htm&quot;,&quot;&quot;,&quot;height=460, width=460, toolbars=no, menubar=no, resizable=yes&quot;);
var data = &quot;<%=html%>&quot;;
pwin.document.writeln(data);
//pwin.print();
//pwin.close();
}

There is also a print button and that is what fails. I would really like to comment out the two lines above and have it close automatically after the user prints, but it just closes the window.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top