Javascript force a dialog box to timeout

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Piyush Parmar

    Javascript force a dialog box to timeout

    Hi.

    I would like to know if it's possible to force a dialog box to
    "expire" after so many seconds? The scenario is that I'm holding
    various objects in my session. Before it times out, I want to notify
    the user to click Okay to save the work now OR click cancel to refresh
    the page. What if the user doesn't respond to the dialog box for a
    long time and then hits save? Well the session has already timed out!

    So, can I have the dialog box appear until the session times out and
    then force a refresh without user interaction? I've seen a similar
    thing done before on bankOfamerica website, but I'm not sure if it's
    with Javascript.

    Thanks!
  • Edwin Martin

    #2
    Re: Javascript force a dialog box to timeout

    Piyush Parmar wrote:[color=blue]
    > Hi.
    >
    > I would like to know if it's possible to force a dialog box to
    > "expire" after so many seconds? The scenario is that I'm holding
    > various objects in my session. Before it times out, I want to notify
    > the user to click Okay to save the work now OR click cancel to refresh
    > the page. What if the user doesn't respond to the dialog box for a
    > long time and then hits save? Well the session has already timed out!
    >
    > So, can I have the dialog box appear until the session times out and
    > then force a refresh without user interaction? I've seen a similar
    > thing done before on bankOfamerica website, but I'm not sure if it's
    > with Javascript.[/color]

    You have to make your own dialog box. Just make a little HTML-page and
    open it with window.open(... ).

    Then you can put a little script like below in this page:

    <script>
    setTimeout( "window.close() ", 60*1000 ); // Close window after 60 sec.
    <script>

    Edwin Martin

    --

    Comment

    Working...