Hi Friends.
I am using javascript to display timer in my .aspx page..I also use javascript to do validations in that page.when i alert the user with a message.i.e when alert function is called,the timer stops and becomes idle.Again when i click the ok button of the message box that occured as a result of alert function ,the timer starts ticking again from where it had left earlier..Time deviation occurs due to this..How to solve it? Someone help in this regard as early as possible..


Thanks & Regards,

Balaguru

Recommended Answers

All 3 Replies

AFAIK, alert() being a blocking function will bring all the processing to a grinding halt. So, to keep the timer running when the alert() is pending for an user action seems to be a pretty difficult task.

One way you can get around this is to display an error message in a custom dialog box (made of div ) or display the error message in a span instead of doing an alert .

But as I always say, client side validation is completely at the mercy of the client and is a moot point. Server side validation is the way to go.

Hi ..

I have no idea with that custom message box.How to do it..?
Kindly provide me with some sample script if u have..

Regards,
Balagurunathan S

For displaying a custom dialog box, you need to use an external javascript library like YUI, Prototype.js, Mootools etc. Here is a simple example using the YUI javascript library.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.