Click to See Complete Forum and Search --> : help please !!!


marshall_73
07-30-2003, 01:28 PM
I'm starting to get a little desperate. Finally I got a part of my script to work, but the final (most important) thing won't work. Here's the script, please tell me what's wrong with it:

<script language="JavaScript">
function WinOpen() {
msg=open("","DisplayWindow","toolbar=no,menubar=no,directories=no");
msg.document.write(Naam3.value+"<br>");
msg.document.write(Straat3.value+"<br>");
msg.document.write(Postcode3.value+" "+Woonplaats3.value+"<br><br><br><br>");
msg.document.write("<input type='button' value='Print dit formulier' onClick='window.print()'>");
}
</script>


The final part of the script (window.print) does not work. If I push the button, it does not do anything. Does someone have the answer??

Gr. M.

Fang
07-30-2003, 01:51 PM
Close your document:

msg.document.close();

Yogg
07-30-2003, 02:24 PM
Try to focus on the window first:

onClick="window.focus();window.print();"

marshall_73
07-30-2003, 03:21 PM
Originally posted by Fang
Close your document:

msg.document.close();


YOU ARE THE BEST !!!!!

Finally it works.

Than you very much maatje..

Gr. M.