Unable to update record from form
- July 9, 2009
- 2 replies
- 1772 views
Hey Folks,
This has been driving me crazy. You click on the submit button and the page refreshes, but no new user is added to the database.
I went and commented out all the IF/Then statements in the following code and I get the error message that FULL_NAME is undefined in FORMS:
<!--- Start of Entry Form Info --->
<cfset CurrentPage=GetFileFromPath(GetTemplatePath())>
<cfif IsDefined("FORM.MM_InsertRecord") AND FORM.MM_InsertRecord EQ "REGISTRATION">
<cfquery datasource="ilmf_parts_dev">
INSERT INTO REGISTRATION (FULL_NAME, USER_GROUP)
VALUES (
<cfif IsDefined("FORM.FULL_NAME") AND #FORM.FULL_NAME# NEQ "">
<cfqueryparam value="#FORM.FULL_NAME#" cfsqltype="VARCHAR2" maxlength="20">
<cfelse>
''
</cfif>
, <cfqueryparam value="#FORM.USER_GROUP#" cfsqltype="VARCHAR2" maxlength="20">
<cfif IsDefined("FORM.USER_GROUP") AND #FORM.USER_GROUP# NEQ "">
<cfqueryparam value="FORM.USER_GROUP">
<cfelse>
''
</cfif>
)
</cfquery>
<cflocation url="Admin.cfm">
</cfif>
If you look at the entire code (see attached text file), FORMs does define the two form elements that I am trying to write to the database. It looks as if Coldfusion does not recognize the two elements during the "IsDefined" section of the IF/THEN section, so the page refreshes without anything being written to the database.
Any help would be appreciated !!
Eric
