Can someone please tell me what I'm doing wrong here? I want this code to check 
for duplicates in a database and then give the javascript error pop-up. 
However, when I add a unique record it keeps giving me the duplicate pop-up 
message.

<CFQUERY name="checkduplicates" datasource="pc_inventory">
Select pcname, ip, serialnumber, oldpcnumber, newpcnumber from inventory
Where id=id
</cfquery>

<CFIF IsDefined ("form.oldpcnumber") and #trim(form.oldpcnumber)# NEQ "" 
or IsDefined ("form.newpcnumber") and #trim(form.newpcnumber)# NEQ "" 
or IsDefined ("form.serialnumber") and #trim(form.serialnumber)# NEQ "">

<CFLOOP Query="checkduplicates">
<CFIF #trim(form.oldpcnumber)# EQ #trim(checkduplicates.oldpcnumber)#>
<Script Language = "Javascript">
alert ("**IDENTICAL PC Number or Serial Number in Database - PLEASE 
RETRY**");window.history.go(-1);
</script>
</CFIF> 
</CFLOOP>
<cfabort>
</CFIF>  

Robert O.

Thanks!


-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.14/130 - Release Date: 10/12/2005
 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:220917
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to