Nope...still no joy....
It works with one field...but not with all of them...
Here are the two codes...
THIS ONE WORKS
<cfset CurrentPage=GetFileFromPath(GetTemplatePath())>
<cfif IsDefined("FORM.MM_UpdateRecord") AND FORM.MM_UpdateRecord EQ "form1">
<cfquery datasource="artists">
UPDATE Sheet1 SET Name=
<cfif IsDefined("FORM.name") AND #FORM.name# NEQ "">
'#FORM.name#'
<cfelse>
NULL
</cfif>
WHERE ID=#FORM.hiddenField#
</cfquery>
<cflocation url="list.cfm">
</cfif>
<cfquery name="update" datasource="artists">
SELECT *
FROM Sheet1
</cfquery>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"_http://www.w3.org/TR/html4/loose.dtd_ (http://www.w3.org/TR/html4/loose.dtd)
">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<form name="form1" method="POST" action="<cfoutput>#CurrentPage#</cfoutput>">
<input name="hiddenField" type="hidden"
value="<cfoutput>#update.ID#</cfoutput>">
<input name="name" type="text" id="name">
<input type="submit" name="Submit" value="Submit">
<input type="hidden" name="MM_UpdateRecord" value="form1">
</form>
</body>
</html>
THIS ONE DOESN'T
<cfparam name="URL.recordID" default="1">
<cfset CurrentPage=GetFileFromPath(GetTemplatePath())>
<cfif IsDefined("FORM.MM_UpdateRecord") AND FORM.MM_UpdateRecord EQ "form1">
<cfquery datasource="artists">
UPDATE Sheet1 SET Name=
<cfif IsDefined("FORM.name") AND #FORM.name# NEQ "">
'#FORM.name#'
<cfelse>
IS NULL
</cfif>
, Surname=
<cfif IsDefined("FORM.Surname") AND #FORM.Surname# NEQ "">
'#FORM.Surname#'
<cfelse>
IS NULL
</cfif>
, Sex=
<cfif IsDefined("FORM.Sex") AND #FORM.Sex# NEQ "">
'#FORM.Sex#'
<cfelse>
IS NULL
</cfif>
, Height=
<cfif IsDefined("FORM.Height") AND #FORM.Height# NEQ "">
'#FORM.Height#'
<cfelse>
IS NULL
</cfif>
, Playing_age=
<cfif IsDefined("FORM.Playing_Age") AND #FORM.Playing_Age# NEQ "">
'#FORM.Playing_Age#'
<cfelse>
IS NULL
</cfif>
, DOB=
<cfif IsDefined("FORM.DOB") AND #FORM.DOB# NEQ "">
'#FORM.DOB#'
<cfelse>
IS NULL
</cfif>
, Hair=
<cfif IsDefined("FORM.Hair") AND #FORM.Hair# NEQ "">
'#FORM.Hair#'
<cfelse>
IS NULL
</cfif>
, Eye=
<cfif IsDefined("FORM.Eye") AND #FORM.Eye# NEQ "">
'#FORM.Eye#'
<cfelse>
IS NULL
</cfif>
, Image=
<cfif IsDefined("FORM.Image") AND #FORM.Image# NEQ "">
'#FORM.Image#'
<cfelse>
IS NULL
</cfif>
, Training=
<cfif IsDefined("FORM.Training") AND #FORM.Training# NEQ "">
'#FORM.Training#'
<cfelse>
IS NULL
</cfif>
WHERE ID=#FORM.hiddenID#
</cfquery>
<cflocation url="list.cfm">
</cfif>
<cfquery name="update" datasource="artists">
SELECT *
FROM Sheet1
WHERE ID = #URL.recordID#</cfquery>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"_http://www.w3.org/TR/html4/loose.dtd_ (http://www.w3.org/TR/html4/loose.dtd)
">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<form action="<cfoutput>#CurrentPage#</cfoutput>" name="form1"
method="POST">
<input name="hiddenID" type="hidden" id="hiddenID"
value="<cfoutput>#update.ID#</cfoutput>">
<input name="name" type="text" id="name"
value="<cfoutput>#update.Name#</cfoutput>">
<input name="Surname" type="text" id="Surname"
value="<cfoutput>#update.Surname#</cfoutput>">
<input name="Sex" type="text" id="Sex"
value="<cfoutput>#update.Sex#</cfoutput>">
<input name="Height" type="text" id="Height"
value="<cfoutput>#update.Height#</cfoutput>">
<input name="Playing_Age" type="text" id="Playing_Age"
value="<cfoutput>#update.Playing_Age#</cfoutput>">
<input name="DOB" type="text" id="DOB"
value="<cfoutput>#update.DOB#</cfoutput>">
<input name="Hair" type="text" id="Hair"
value="<cfoutput>#update.Hair#</cfoutput>">
<input name="Eye" type="text" id="Eye"
value="<cfoutput>#update.Eye#</cfoutput>">
<input name="Image" type="text" id="Image"
value="<cfoutput>#update.Image#</cfoutput>">
<input name="Training" type="text" id="Training"
value="<cfoutput>#update.Training#</cfoutput>">
<input type="submit" name="Submit" value="Submit">
<input type="hidden" name="MM_UpdateRecord" value="form1">
</form>
</body>
</html>
AAAAAAAAAAAAAAAAARGH!
Dan
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:208984
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