?
Solved

Confirm Countdown

Posted on 2003-02-20
3
Medium Priority
?
822 Views
Last Modified: 2008-03-10
I have a script that is for managing user sessions. Before the user's session ends, a confirm dialouge pops up asking if the user would like to renew their session.

My question is, can I have the actual alert box time out after 60 seconds if no option is selected?
Also, can the confirm box display a countdown or does this have to be done on an HTML page/window?

Here is the code:
<cfif IsDefined("url.sessionwatch")>
<html>
<head><title></title></head>
<body>
<table width="100%"><tr><td align="center"><form>
Session extended.<br>
<input type="submit" onclick="window.close();" value="OK">
</form></td></tr>
</table>
<script>
window.close();
</script>
</body></html>
<cfabort>
</cfif>

<cfparam name="attributes.launchTime" default="20">

<cfoutput>
<cfset thisLaunchTime = (attributes.launchTime * 60 * 1000)>

<script language="Javascript">
     function watchSession() {
          timerID = setTimeout("refreshSession()", #thisLaunchTime#);
     }
     
     function refreshSession() {
          if (confirm("Your session will timeout in 60 seconds. Would you like to extend the session?")) {
               
               
               serverCall = window.open(document.location.href.split("?")[0]+"?sessionwatch=1", "RefreshSession", "width=150, height=50");
               watchSession();
          }
          else window.location="logout.cfm";
     }

     watchSession();
</script>
</cfoutput>
0
Comment
Question by:weeezl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Expert Comment

by:webandit
ID: 7989220
You definitly have to use a small html window for that.  There is no way to control a dialog box with javascript.  For security reasons, it makes sense, because of all the popup ad idiots out there.  If we were able to control events of a dialog box, we would have less security as a user for the choice.
You will have to mimic the dialog box with a new window.  You could get it really close if you press the print screen button, and slice up the dialog box image.  Could look really fancy.

Sorry

J
0
 
LVL 16

Expert Comment

by:jaysolomon
ID: 10082567
*******************************************************
******PLEASE DO NOT ACCEPT THIS COMMENT AS ANSWER******
*******************************************************
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area:
RECOMMENDATION:

 - [PAQ No Refund]

Please leave any comments here within the next seven days.
*******************************************************
******PLEASE DO NOT ACCEPT THIS COMMENT AS ANSWER******
*******************************************************

jAy
EE Cleanup Volunteer
0
 

Accepted Solution

by:
SpazMODic earned 0 total points
ID: 10132965
PAQed - no points refunded (of 100)

SpazMODic
EE Moderator
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question