wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets 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: 207

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: 60740
    
  65

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

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

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

Joined: Mar 22, 2005
Posts: 41035
    
  43
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Disabling Refresh Button
 
Similar Threads
how to create timer in jsp?
Struts 2 <s:submit action > and javascript help
Java Script problem
Does Onload supported in Mozilla Firefox 3.6
Updating GUI properties