473,785 Members | 2,424 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HELP with Timer...

Mel
I have an entry field and a long number "33424JHKJHKJ43 432423" as well
as a submit button "FINISHED".

I need to know "HOW LONG" it takes for the user to enter the number
correctly ! if incorrect, it should popup an alert and ask user to
correctly enter the number again and then press FINISHED button

Can someone help me a little Codelet ?

thanks

Jul 31 '06 #1
1 1434

Mel wrote:
I have an entry field and a long number "33424JHKJHKJ43 432423" as well
as a submit button "FINISHED".

I need to know "HOW LONG" it takes for the user to enter the number
correctly ! if incorrect, it should popup an alert and ask user to
correctly enter the number again and then press FINISHED button

Can someone help me a little Codelet ?

thanks
Mel, lets see if this is enough to get you started:
<script>
function userKeyDown(){
if(!arguments.c allee.start){
arguments.calle e.start = new Date();
}
}
function validate(){
var start = userKeyDown.sta rt;
if(start) {
var finished = (new Date()).getTime ();
var diff = finished - start.getTime() ;
userKeyDown.sta rt = null;
alert("User took " + diff + " milliseconds to fill field");
}else{
alert("no start time");
}
// Validate your form field here
}
</script>

<form>
<input type="text" onkeydown="user KeyDown();">
<input type="button" onclick="valida te()" value="finished " />
</form>

Jul 31 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
574
by: wukexin | last post by:
I write my own class Cfile, I want to know what about implement ctime().Who help me? My use function ctime, I sign it with $$$. my class Cfile: #------------------------ file.h #--------------------------- #include <io.h> #include <ctime> #include <string>
9
5170
by: tym | last post by:
HELP!!! I'm going round the twist with this... I have a VB6 application which is using DAO to access a database (Please - no lectures on ADO, I know what I'm doing with DAO!!) Ok, problem is this.... importing a large csv file (189000 lines, 7 fileds per line)
2
1948
by: MyNameIsnt | last post by:
Can anyone tell me why, when I click on the buttons it register 2 characters on the display? if you use the right mousebutton it works ok, but the buttons dont flash?? it works fine without the aqua buttons, (using just windows forms buttons... Main Form cs file //----------------------------------------------------------------------------------------------------------------------
2
1429
by: Alfonso Morra | last post by:
Hi, I am writing a timer class that I want to be able to get to notify me (via a callback func), when a specified interval has elapsed. I have most of the timer functionality figured - however, I need to spawn a new thread to carry out the "time watch" - and I need to do this in a cross platform (Well Linux/Windows) way ... Any help will be much appreciated. The code (snippet) follows below:
10
2709
by: WhiteSocksGuy | last post by:
Help! I am new to Visual Basic .Net (version 2002) and I am trying to get a System.Timers.Timer to work for me to display a splash screen for about two seconds and then load the main form. I have two forms (frmSplash and frmMain) and a code Module setup as my startup object. Here is the code that I have, when I try to run this part of the splash screen form shows and then program terminates. What am I doing wrong? Thanks,
7
7121
by: steve marchant | last post by:
trying to learn VB6. Simple counting loop which counts to 8 in 1 sec intervals, then starts from 1 again and repeats. Have two Command buttons on the form. Cmd1 starts the counting, and I need to know how to stop it with Cmd2. Here's my code so far: Private Sub Command1_Click() Dim x, y, m m = 1 Do Print m
4
1917
by: Lemune | last post by:
Hello everyone. I'm using vb 2005. I'm creating program that run as service on windows. And in my program I need to use timer, so I'm using timer object from component. I try my source code on another project that use windows form and it work. But when I implement my source code on my program that run as service on windows (I have change the code so it would work on service but I still use timer object from component), and it doesn't...
11
1976
by: Zilla | last post by:
I have the following simple program. I just want to be able to do math operations (+, -, =)on Timer sublcasses, but want to handle cases where either rhs or lhs is an intrinsic value, However, the compile fails in my g++ 2.95 compiler during the 2nd to last line of the main() with template.cpp: In function `int main()': template.cpp:24: `operator +<int>(int, const int &)' must have an argument of class or enumerated type template.cpp:...
3
1350
by: mxmillercell | last post by:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace timertest {
5
3308
by: dm3281 | last post by:
I'm really starting to hate writing services -- or trying to, anyway. Why do I need to rename my project to the service name? Why do I need to set the "ServiceName" property to my service name? Why do I need to set a property within my code to the service name? Are all these required or am I just doing this for consistency purposes?
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10161
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9958
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8986
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4058
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3662
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2890
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.