Using setTimeout function in APEX
428571Mar 18 2009 — edited Mar 26 2009Hi,
I am trying to show a print dialog box after which I need to take confirmation from the user whether the printout has come fine or not. For acheving this I am trying to use setTimeout in javascript which is not working. The confirmation box is coming before print dialog box which I do not want to happen.
Below is the code I am writing in APEX
//-----------------------------------------------------------------------------------------------------------------------
<html>
<head>
<script language="JavaScript1.1" type="text/javascript">
function updatePrintFlag()
{
var print_flag = confirm("Has the printout come fine?");
if(print_flag==true)
alert('Printout has come fine. Updating in the database');
}
function callPrint()
{
window.print();
var sleep = setTimeout(updatePrintFlag(),2000);
alert(print_flag);
}
</script>
</head>
<body onload='callPrint()'>
<font size=2>Asking confirm after 2 Secs of print dialog box</font>
</body>
</html>
//-----------------------------------------------------------------------------------------------------------------------
Please help me in this issue. Thank you.
Regards
Dev
Edited by: lvijaya.kumar@gmail.com on 18-Mar-2009 03:17