This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Disabling Refresh Button Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Disabling Refresh Button" Watch "Disabling Refresh Button" New topic
Author

Disabling Refresh Button

Sagar Shroff
Ranch Hand

Joined: Jun 07, 2011
Posts: 182

Hello i am having an a web page on which conducts online exam.I have used the following javascript for creating a time exam count down time




Now my problem here is that when i click refresh button the timer resets itself and that is WRONG because that will give the users extra time to finsh the exam paper.
I googled and all they were suggesting me is to handle it using session rather then disabling.
Any suggestions please ?

OCJP-90%,OCPWCD-95%
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56192
    
  13

Luckily, you can't. Please read InterfaceDesignersRule1. You shouldn't be trying to stick your fingers where they don't belong.

Keep track of the timer in the session as you've already discovered.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Sagar Shroff
Ranch Hand

Joined: Jun 07, 2011
Posts: 182

Bear Bibeault wrote:Luckily, you can't. Please read InterfaceDesignersRule1. You shouldn't be trying to stick your fingers where they don't belong.

Keep track of the timer in the session as you've already discovered.



could you please elaborate how would things work by putting the timer in session.
Thanks
Sagar Shroff
Ranch Hand

Joined: Jun 07, 2011
Posts: 182

Can someone please help !? IS There no 1 with a solution to my problem ??
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
PatienceIsAVirtue. It's a weekend right now.


Android appsImageJ pluginsJava web charts
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 16483
    
    2

Come on, it's not that hard. Whatever generates that page will also put the current time into the session. That's the basis for your timer. If you need to notify the user immediately when the timer expires, you can send an AJAX request every second which compares the current time to the time in the session and see if it's expired.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Disabling Refresh Button
 
Similar Threads
Java Script problem
Does Onload supported in Mozilla Firefox 3.6
Struts 2 <s:submit action > and javascript help
Updating GUI properties
how to create timer in jsp?