luc
06-30-2003, 08:51 AM
Hello,
I try to print a webpage with window.print(), but before the document begins to print, the form must be posted so that my server-based application could recalculate totals.
I tried to do it like below, and within IE 6.0 no problem, but in IE 5.0, after the post, I get the totals correct. After the page is posted I get the dialog window to select my printer. The totals on the printer are the same as before, on my screen I get the totals are updated. When I do this again. Not any time the totals wil be changed on the printer, on screen OK.
I don't know if this method is the good-one... Maybe a nice solution exists?
Thx a lot...
<html>
<head>
<title>test</title>
<script>
function printDoc()
{
document.forms[0].pPrintDoc.value="yes"
document.forms[0].submit()
}
</script>
</head>
<body>
<FORM NAME="update" METHOD="post">
<input type="hidden" name=pPrintDoc>
<input type="text" name=pResult>
....
<input type="button" name=btnPrint value="Print" onClick="printDoc()">
</FORM>
</body>
</html>
<script>
if (document.forms[0].pPrintDoc.value=="yes")
{
document.forms[0].pPrintDoc.value=""
window.print()
}
</script>
I try to print a webpage with window.print(), but before the document begins to print, the form must be posted so that my server-based application could recalculate totals.
I tried to do it like below, and within IE 6.0 no problem, but in IE 5.0, after the post, I get the totals correct. After the page is posted I get the dialog window to select my printer. The totals on the printer are the same as before, on my screen I get the totals are updated. When I do this again. Not any time the totals wil be changed on the printer, on screen OK.
I don't know if this method is the good-one... Maybe a nice solution exists?
Thx a lot...
<html>
<head>
<title>test</title>
<script>
function printDoc()
{
document.forms[0].pPrintDoc.value="yes"
document.forms[0].submit()
}
</script>
</head>
<body>
<FORM NAME="update" METHOD="post">
<input type="hidden" name=pPrintDoc>
<input type="text" name=pResult>
....
<input type="button" name=btnPrint value="Print" onClick="printDoc()">
</FORM>
</body>
</html>
<script>
if (document.forms[0].pPrintDoc.value=="yes")
{
document.forms[0].pPrintDoc.value=""
window.print()
}
</script>