Click to See Complete Forum and Search --> : Print window 2 from window 1???


kwilliams
07-16-2003, 09:11 AM
Hello, and thanks in advance.

I basically want to create a way to print window 2 by using a Submit button on window 1. The original window 1 is already a popup window, and window 2 just opens up in that same window, which is fine.

I've tried two options, but they both print window 1...not window 2. This is what I've tried so far:

1) Using Submit Button:
<input type="submit" value="Print" name="submit" onClick="javascript:window.print('emplapp.asp?id=<%=Session("MM_recordId")%>')"

2) Using Function:
function printjob(){
location.URL=('emplapp.asp?id=<%=Session("MM_recordId")%>');
window.print()}
</script>

Both of these examples required the following in the form tag:
<form name="form1" method="post" action="emplapp.asp?id=<%=Session("MM_recordId")%>')">

All suggestions & ideas are appreciated. Thanks for any help.

KWilliams

Khalid Ali
07-16-2003, 09:48 AM
windowName.print();

however you have to make sure that the window if its self then it will be just window.print and if you aretrying to print a child window then it will be
windowName.print();