Scott,

Try this - it consists of 2 forms.
A launching form... and the printing form.

Generally, you want to print the page currently displayed.
This example will require that you populate "Test2" with the same
information on Test1.
I did this because you wanted to close the form... and I assume you did not
wish to close Test1.

If you wanted to keep it on the same form...
-add the PrintDialog function to form1
-ditch form2
-change the href in test1 to javascript:PrintDialog();
-remove the target
-change window.close; to self.history.go(-1);

If anyone knows a better way... I would be interest in knowing... I have a
similiar need.

TIA,

Pierre
[EMAIL PROTECTED]
The Next Revolution, LLC

===================================================
<!-- Test1.cfm -->
<html>
<head><title>Untitled</title></head>
<body>
<a href="Test10.cfm" target="_new">Click Here To Print</a>
</body>
</html>
===================================================
<!-- Test2.cfm -->
<html>
<head><title>Untitled</title>

<script language="JavaScript">
<!-- Begin
function PrintDialog() {
window.print();
window.close();
}
// End -->
</script>
</head>

<body onLoad="javascript:PrintDialog();">
This is a test of the emergency broadcasting system.
</body>
</html>




-----Original Message-----
From: Raley, Scott [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 28, 2001 3:38 PM
To: CF-Community
Subject: Javascript help



I'm using the script below to bring up a print dialog box. Can anyone tell
me how when this is clicked it brings up the print dialog box and closes the
page it was launched from?  I tried adding in another onclick event to close
the window but it didn't work (although my code may not have been
correct)... TIA


 <SCRIPT LANGUAGE="JavaScript">
<!-- Begin
if (window.print) {
document.write('<form> '
+ '<input type=button name=print value="Print Report" '
+ 'onClick="javascript:window.print()"> </form>' );
}
// End -->
</script>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to