How about like this: onClick="javascript:window.print(); window.close()"

You need to do this in a popup window. The close function will prompt the
user if its done in a parent window.

Shawn Regan
Applications Developer
Pacific Technology Solutions 

-----Original Message-----
From: Raley, Scott [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 28, 2001 12: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