473,500 Members | 1,929 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Validate 1st field on form

Hi

I have a form that users fill in, thefirst field is a username, which
must be unique.
Currently only when I attempt the Insert into the DB does the restaint
inform the user that it already exists.
Is there any way i can check , let say onblur, if that username
exists, so that they dont have to complete the whole form before being
informed?

thanks

marius
Jul 19 '05 #1
2 1590
a) You could use an XML data island. Here's an example (you will need to
modify it for your purpose - the intent is simply to demonstrate how to pass
the XML to the client):
http://www.davidpenton.com/testsite/...ta.islands.asp

b) You could pass a recordset to the client using XML like this:
http://www.davidpenton.com/testsite/...ver2client.asp,
allowing you to use rs.Find to see if the user has entered a previously-used
name.

c) You could use the XMLHTTPRequest object to pass the user name to another
asp page which determines whether or not it is already used and returns the
result to the calling page.

HTH,
Bob Barrows

Marius wrote:
Hi

I have a form that users fill in, thefirst field is a username, which
must be unique.
Currently only when I attempt the Insert into the DB does the restaint
inform the user that it already exists.
Is there any way i can check , let say onblur, if that username
exists, so that they dont have to complete the whole form before being
informed?

thanks

marius

Jul 19 '05 #2
On 9 Sep 2003 07:22:34 -0700, ma**********@ananzi.co.za (Marius)
wrote:
Hi

I have a form that users fill in, thefirst field is a username, which
must be unique.
Currently only when I attempt the Insert into the DB does the restaint
inform the user that it already exists.
Is there any way i can check , let say onblur, if that username
exists, so that they dont have to complete the whole form before being
informed?

To do this, you would need one of the following on client side.

A. A list of all current usernames. Probably not practical, plus it
would reveal all usernames to anyone who wanted to look at the source
code :)

B. A way to look up a name quickly on the server. There are a couple
ways of doing this, but the concept of "quick" is relative here. In
all but the best conditions, the turnaround time may be more than what
you want to handle "onblur".

You need to balance the steps you take with the expected value.
Assuming you repopulate the form if a username is not unique, I would
say you are doing fine - especially if you are using a stored
procedure to do the insert. This way, you can check for an existing
username before actually attempting the insert.
Jul 19 '05 #3

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

Similar topics

6
2313
by: deko | last post by:
I have a basic Feedback form - I want to prevent blank entries. The problem with the below code is that the form still Posts if the 'message' field is blank. The form will not post if the...
13
4758
by: Eddie | last post by:
I need to validate a text input field. I just want to say if user enters 93101 or 93102 or 93103 or 93105 or 93106 or 93107 or 93108 or 93109 or 93110 or 93111 or 93116 or 93117 or 93118 or...
2
1864
by: Meredith | last post by:
I am using a script to validate a form using the presence of a value in one field and determine if there is a value in one of two fields. It is an either/or situation. If the date rcvd field is...
4
4267
by: Wysiwyg | last post by:
I need to validate a form to ensure that all of the fields add up correctly. I can't do this while the user is entering data since validation needs to be done after the entry is completed. What's...
3
5941
by: Martin | last post by:
Hi, I am implemeting a form in asp.net. The form is quite large and the validation is reasonably complex, so I have decieded to implement my own validation rather than use any custon...
9
6646
by: B-Dog | last post by:
I have a form that has about 10 text boxes on it, they all have to be filled out before submitting is there a quick way to make sure that none are null or do I have to call out each textbox? Say...
3
2010
by: c676228 | last post by:
Hi everyone, I just realized that it's so important to validate each string, I mean 'each' before you insert data from asp page into database. I guess some customers just copy data from some...
11
8109
by: TokyoJ | last post by:
I run a small camp in Alaska for kids and my director is asking for a web form. Could someone please have a look and offer some advice on where I'm making mistake(s)? I'm using the RegExp function...
1
3963
by: SkipNRun | last post by:
I am a novice when comes to JavaScript, AJAX. I am working on a form, which will allow users to update their contact information. In order to make the form flexible, I need to use pull down list. ...
1
2822
by: mbarnhizer | last post by:
Hello All, Trying to figure out how to validate a series of questions on an online test. I am thinking that VB or Javascript is the best route, but your input may make a difference. The site i...
0
7136
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,...
0
7018
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7182
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,...
1
6906
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7397
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...
0
5490
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,...
0
4611
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...
0
3110
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3106
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.