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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Managing a pop window for printing

Status
Not open for further replies.

awingnut

Programmer
Feb 24, 2003
759
US
I created a popup window for printing some textarea information and have 2 problems. The function I use is:
Code:
function startFax(theForm) {
	newwindow=window.open("","printwin","height=450,width=600");
	newwindow.document.write("<body onload='window.focus();window.print()'>"+theForm.faxdata.value+"</body>");
	newwindow.document.close();
}

1) I'd like to not have the new window displayed (I can live with it if hiding it is not possible).
2) The window is not closing after the print dialog completes.

Can someone help me with this? TIA.
 
Thanks but I'm not sure what happened. That certainly closed the window but now my print dialog does not come up.
 
Ah, ha! Your suggestion was an addition not a replacement, right? Using both closes, worked. Thanks.
 
It's closing the window before it even gets a chance to print.

There is potentially a VERY easy way to solve this. It depends on one factor:

Will you ever need to allow them to print out the entire page, or is it acceptible to print out ONLY the textarea EVERY time the page is printed? [small](even if they go thru the print properties in the browser: File > Print)[/small]

-kaht

[small]How spicy would you like your chang sauce? Oh man... I have no idea what's goin' on right now...[/small]
[banghead]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top