|
-
Oct 1st, 2001, 10:41 AM
#1
Thread Starter
Fanatic Member
Validating a control array
I have a control array where people can enter data. This data needs to be validated against a database.
What I want to happen is if someone tries to tab forwards through the control array, their entry will be validated. However, if they tab backwards, it should not be validated.
An example might help, here. Say I have three controls in my array: Surname, FirstName and PhoneNo (in that order). If someone types in "Smith" and then tabs onto the FirstName field, their entry should be tested to see whether it exists on the DB. If it does, they are allowed to continue; if it doesn't they are alerted and Surname keeps the focus.
Once they have given a valid surname, they then want to fill in a FirstName. If they type in "John" and tab forward to the PhoneNo field, "John" should be validated against the Smiths in the DB. However, if they suddenly realise that they should have been looking for "Jones" and try to tab back to the Surname field, they don't want to keep being advised that they have entered an invalid FirstName (or have entered nothing at all).
Is there anyway that I can test where the focus is going before deciding whether to validate the entry?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|