Since you are probably going to store the information from the form when
they submit it the first time, why not add a flag field that identifies the
action 'state' of a particular record. If each user is uniquely identifiable
then just do a quick search on that identifier before inserting form data.
If a record already exists for that particular id then disallow the new
information.

---------------------------

<CFQUERY
  Name="qry_MyQuery"
  Datasource="MyDSN">
  SELECT UID
  FROM USERS
  WHERE UID = '#FORM.UID#'
</CFQUERY>

<CFIF qry_MyQuery.Recordcount EQ 0>
  <CFQUERY
    Name="qry_InsertQuery"
    Datasource="MyDSN">
    INSERT INTO USERS (username, fname, lname, email)
    VALUES ('#FORM.username#', '#FORM.fname#', '#FORM.lname#',
'#FORM.email#')
  </CFQUERY>
<CFELSE>
  ... Record already exists
</CFIF>

---------------------------

Steve

-----Original Message-----
From: Jason Larson [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 30, 2000 2:11 PM
To: CF-Talk
Subject: Submit a Form once



I was wondering if anybody had some cf code, that allows the user to only
submit a form once.

Thanks
Jason

----------------------------------------------------------------------------
--------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a
message with 'unsubscribe' in the body to [EMAIL PROTECTED]

------------------------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists or send a message 
with 'unsubscribe' in the body to [EMAIL PROTECTED]

Reply via email to