myselfrandhawa,
Thank you for this!
OK, I tried out your code in my action file: data_insert.cfm. We got rid of the error. However, it looks like the form does not fully process, and the form submission gets stuck on the action page and never posts the output of the form. Take a look here:
http://ebwebwork.com/cep/c
Question: does that first query need a query name?
<cfquery datasource="ebwebwork" dbname="ebwebwork">
If you have time, please let me know what you think?
Thanks again. I always appreciate your help. Hope you are well.
Eric
action file: data_insert.cfm:
<cfif isDefined('FORM.AwareCEPAnnualReportsStateTests')>
<!--- radio input has been checked and is present in post data --->
<cfset AwareCEPAnnualReportsStateTests = 1>
<cfelse>
<cfset AwareCEPAnnualReportsStateTests = 0>
<!--- radio input not checked and not present --->
</cfif>
<cfif isDefined('FORM.informationcontainedreportsuseful')>
<!--- radio input has been checked and is present in post data --->
<cfset informationcontainedreportsuseful = 1>
<cfelse>
<cfset informationcontainedreportsuseful = 0>
<!--- radio input not checked and not present --->
</cfif>
<cfif isDefined('FORM.awareCEPotherwork')>
<!--- radio input has been checked and is present in post data --->
<cfset awareCEPotherwork = 1>
<cfelse>
<cfset awareCEPotherwork = 0>
<!--- radio input not checked and not present --->
</cfif>
<!--- Insert values into table CEP_Survey_Responses columns --->
<cfquery datasource="ebwebwork" dbname="ebwebwork">
INSERT INTO CEP_Survey_Responses (
affiliation,
AwareCEPAnnualReportsStateTests,
informationcontainedreportsuseful,
howuseddatacontainedreports,
adviceimprovereports,
awareCEPotherwork,
whatworkawareof,
howimproveworkintheseareas,
DateCreated)
VALUES(
<cfqueryparam cfsqltype="cf_sql_varchar" value="#affiliation#">,
<cfqueryparam cfsqltype="cf_sql_varchar" value="#AwareCEPAnnualReportsStateTests#">,
<cfqueryparam cfsqltype="cf_sql_varchar" value="#informationcontainedreportsuseful#">,
<cfqueryparam cfsqltype="cf_sql_varchar" value="#howuseddatacontainedreports#">,
<cfqueryparam cfsqltype="cf_sql_varchar" value="#adviceimprovereports#">,
<cfqueryparam cfsqltype="cf_sql_varchar" value="#awareCEPotherwork#">,
<cfqueryparam cfsqltype="cf_sql_varchar" value="#whatworkawareof#">,
<cfqueryparam cfsqltype="cf_sql_varchar" value="#howimproveworkintheseareas#">,
<cfqueryparam cfsqltype="cf_sql_timestamp" value="#now()#">)
</cfquery>
<cfquery datasource="ebwebwork" dbname="ebwebwork" name="CEP_Survey_Responses">
SELECT scope_identity() AS ident
FROM CEP_Survey_Responses
</cfquery>
<!--- pass the survey responses back to the previous page --->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Your Consumer Survey Response was sent to CEP</title>
</head>
<body>
<!--- post inputs from FORM --->
<cfoutput>
<form name="form" method="post" action="index.cfm">
<!--- set value from newly created SurveyResponseID --->
<input type="hidden" name="SurveyResponseID" value="#CEP_Survey_Responses.ident#">
<!--- set rest of values from submitted form --->
<input type="hidden" name="affiliation" value="#FORM.affiliation#">
<cfif isdefined("form.AwareCEPAnnualReportsStateTests")>
<input type="hidden" name="AwareCEPAnnualReportsStateTests" value="#FORM.AwareCEPAnnualReportsStateTests#">
<cfelse>
<input type="hidden" name="AwareCEPAnnualReportsStateTests" value="0">
</cfif>
<cfif isdefined("form.informationcontainedreportsuseful")>
<input type="hidden" name="informationcontainedreportsuseful" value="#FORM.informationcontainedreportsuseful#">
<cfelse>
<input type="hidden" name="informationcontainedreportsuseful" value="0">
</cfif>
<input type="hidden" name="howuseddatacontainedreports" value="#FORM.howuseddatacontainedreports#">
<input type="hidden" name="adviceimprovereports" value="#FORM.adviceimprovereports#">
<cfif isdefined("form.awareCEPotherwork")>
<input type="hidden" name="awareCEPotherwork" value="#FORM.awareCEPotherwork#">
<cfelse>
<input type="hidden" name="awareCEPotherwork" value="0">
</cfif>
<input type="hidden" name="whatworkawareof" value="#FORM.whatworkawareof#">
<input type="hidden" name="howimproveworkintheseareas" value="#FORM.howimproveworkintheseareas#">
<input type="hidden" name="DateCreated" value="#DateFormat(now(), "mm/dd/yyyy")#">
</form>
</cfoutput>
</body>
</html>
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97: 98: 99: 100: 101: 102: 103: 104: 105: 106: 107: 108: 109: 110: 111: 112: 113: 114: 115: 116: 117: 118: 119: 120: 121: 122: 123: 124: 125: 126: 127: 128: 129: 130: 131: 132: 133:





by: myselfrandhawaPosted on 2009-10-25 at 00:42:11ID: 25655855
Hi Eric:
Two things. I had did a liittle modification inyour code:
here are they
i separated the select statement and put in in a different query after the insert statement so it should carry a relevant value which you do the insert.
i am unable to test it so i assume that can solve the purpose you are trying to do.
Check and post back if something goes wrong.
Select allOpen in new window