Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Countdown Timer

Status
Not open for further replies.

Laeg

Programmer
Nov 29, 2004
95
0
0
IE

I need a countdown timer from 3 minutes to that has 2 events.

1] When timer reaches 0, Event1 fired "Time Up" message
2] A specific user action, Event 2 fired, timer reset to 3 minutes.

The problem I have is how to display the clock to the user but yet have the application retain control. I don't want the user to be able to get around the logic of the timer and reset it to 0 or simply skip over the timer altogether. For example if I use an ajax control the user can override this by turning javascript off. How would I go about ensuring that the user sees the timer and all events are fired as they should be?

Thanks for replies
 
1st thing is to clarify the languages/technologies used. 1st you mention an event timer. and being the c# forum we would naturally assume you are talking about 1 of the timer objects in the .net framework.

then you mention ajax, which is a different environment, language.. well a different context all together.

so, assuming now a web context, .net timers are out. as the .net code is server side. so you timer would be on the client. which means javascript. as you mentioned a user can disable javascript. there is no way around that. 2 options around this are:
1. have the user experience degrade quietly to non-ajax behavior if js is disabled.
2. have the browser test for the availability of js. if it's not there (disabled) display a message to the user stating the user must enable js to view the website. for more help with either of these options I would use forum216 and forum215.

I would also highly recommend using a js library (jquery, mootools, protype or dojo) for your client scripting. otherwise you have to write alot of plumbing/infrastructure code to handle browser variations.

as for your other questions above preventing the user from overriding timer control. This may be better addressed after addressing the js issue and explaining the context using the appropriate language.

Jason Meckley
Programmer
Specialty Bakers, Inc.

faq855-7190
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top