wood burning stoves*
The moose likes HTML, CSS and JavaScript and the fly likes Disabling Refresh Button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Disabling Refresh Button" Watch "Disabling Refresh Button" New topic
Author

Disabling Refresh Button

Sagar Shroff
Ranch Hand

Joined: Jun 07, 2011
Posts: 208

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: 61092
    
  66

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Sagar Shroff
Ranch Hand

Joined: Jun 07, 2011
Posts: 208

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: 208

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

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


Ping & DNS - my free Android networking tools app
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Disabling Refresh Button