Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using setTimeout function in APEX

428571Mar 18 2009 — edited Mar 26 2009
Hi,

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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 15 2009
Added on Mar 18 2009
2 comments
2,867 views