What you might want to do is this:

Create an action page that your form, that you have built already, is
submitted to.

On the action page first run a query that checks that database of users
against the form input, say on Last Name.

Then have a <cfif> that checks for the record count from the first query to
be 0 (zero) and if that condition is met, then do your insert.  <cfelse>
Send them back to the login screen with a notice that the information they
submitted already exists.

<cfquery datasource="#dsn"# name="checkUser">
        SELECT Last_name
        FROM yourTable
        WHERE Last_Name = '#form.last_name#'
</cfquery>
<cfif checkUser.recordCount IS 0>
        INSERT INFORMATION QUERY
<cfelse>
        <cflocation url="yourloginpage.cfm" addtoken="NO">
        <cfabort>
</cfif>


There are other ways of doing log in pages, but I think this will accomplish
what you are looking for.

Steven Semrau
SRA International, Inc.
Senior Member, Professional Staff
[EMAIL PROTECTED]
[EMAIL PROTECTED]
Com:  (703) 805-1095
DSN:  (703) 655-1095


-----Original Message-----
From: Jones, Becky [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 16, 2001 4:27 PM
To: CF-Talk
Subject: validation


i want to have a form where i can insert a new user into my database.  and i
have that form but i want to be able to validate it before it submits this
new user into my database.  i want to check to make sure the person doesnt
already exist. (it wont be me entering the data, so i dont want to have user
input errors if they dont search thru the drop down list before adding a new
person...resulting in duplicate people).
someone told me to look thru the custom tags and i did...but i really dont
see what i am looking for.  
can anyone give me any ideas or some direction?  
thanks for all your help,
bec.


*************************************************
This e-mail, including any attachments, is intended for the 
receipt and use by the intended addressee(s), and may contain 
confidential and privileged information.  If you are not an intended 
recipient of this e-mail, you are hereby notified that any unauthorized 
use or distribution of this e-mail is strictly prohibited.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to