File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 202

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: 60057
    
  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: 202

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

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

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


Ping & DNS - updated with new look and Ping home screen widget
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18135
    
    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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Disabling Refresh Button
 
Similar Threads
Java Script problem
Struts 2 <s:submit action > and javascript help
Updating GUI properties
Does Onload supported in Mozilla Firefox 3.6
how to create timer in jsp?