JohnLucania
asked on
Element FIELDNAMES is undefined in FORM
What I need to do is:
<cfif not isdefined("form.fieldNames ")>
...
<cfelse>
...
</cfif>
<cfif not isdefined("form.fieldNames ")> returns 'Element FIELDNAMES is undefined in FORM'
How to do?
<cfif not isdefined("form.fieldNames
...
<cfelse>
...
</cfif>
<cfif not isdefined("form.fieldNames
How to do?
ASKER
yes, it causes.
Sorry,
That can't be true, can you paste your code, i'd say something after the <cfif is causing the error, not that if line.
That can't be true, can you paste your code, i'd say something after the <cfif is causing the error, not that if line.
ASKER
<cfif isdefined("form.fieldNames ")> <!---for Delete ID --->
<CFLOOP LIST="#form.fieldNames#" index="myInd">
<CFIF LEFT(myind,4) eq "INST">
<!--- we have found an installment record ---->
<!---
<CFSET myInstaID = Right(myInd,len(myInd)-4)>
<CFSET myInstaAmount = Evaluate('form.InAmount'&m yInstaID)>
<CFSET myInstaDate = Evaluate('form.InDate'&myI nstaID)>
--->
<cfscript>
myInstaID = Right(myInd, Len(myInd) - 4);
// give the variable a reasonable default
myInstaAmount = 0;
// if it exists in the form scope, reset to the form field value
if(StructKeyExists(form, 'InAmount' & myInstaID))
myInstaAmount = form['InAmount' & myInstaID];
// give the variable a reasonable default
myInstaDate = '';
// if it exists in the form scope, reset to the form field value
if(StructKeyExists(form, 'InDate' & myInstaID))
myInstaDate = form['InDate' & myInstaID];
</cfscript>
<!--- update the installment record found --->
<CFIF isNumeric(myInstaAmount) AND isDate(myInstaDate) AND isNumeric(myInstaID)>
<!---proceed only if we have a good date and amount --->
<cfquery datasource="#REQUEST.USLAX DSN#" name="UpdateInstallment">
UPDATE PledgeInstallments
SET installDate = '#DateFormat(myInstaDate, 'mm/dd/yyyy')#',
installAmount = #myInstaAmount#
WHERE pledgeID = #session.myPledgeID# AND installID = #myInstaID#
</cfquery>
</CFIF>
</CFIF>
</CFLOOP>
<cfelse> <!---for Delete ID --->
<cfparam name="clickID" default="0">
<!--- Delete records --->
<CFIF LEFT(myind,6) eq "Delete">
<!---CFSET myDeleteID = Right(myInd,len(myInd)-4) />--->
<cfparam name="callerId" default="0">
<!--- delete the installment record checked
<CFIF isDefined("form.Delete#myI nstaID#")> --->
<!---proceed only if we have a good date and amount --->
<cfquery datasource="#REQUEST.USLAX DSN#" name="DeleteInstallment">
update PledgeInstallments
set InstallDeleteDate = '#DateFormat(Now(), 'mm/dd/yyyy')#'
WHERE pledgeID = #session.myPledgeID# AND installID = #url.callerId#
</cfquery>
<!---</CFIF>--->
</CFIF>
<!--- Delete records <cfoutput>#callerId#</cfou tput> --->
</cfif> <!--- for Delete ID --->
<CFLOOP LIST="#form.fieldNames#" index="myInd">
<CFIF LEFT(myind,4) eq "INST">
<!--- we have found an installment record ---->
<!---
<CFSET myInstaID = Right(myInd,len(myInd)-4)>
<CFSET myInstaAmount = Evaluate('form.InAmount'&m
<CFSET myInstaDate = Evaluate('form.InDate'&myI
--->
<cfscript>
myInstaID = Right(myInd, Len(myInd) - 4);
// give the variable a reasonable default
myInstaAmount = 0;
// if it exists in the form scope, reset to the form field value
if(StructKeyExists(form, 'InAmount' & myInstaID))
myInstaAmount = form['InAmount' & myInstaID];
// give the variable a reasonable default
myInstaDate = '';
// if it exists in the form scope, reset to the form field value
if(StructKeyExists(form, 'InDate' & myInstaID))
myInstaDate = form['InDate' & myInstaID];
</cfscript>
<!--- update the installment record found --->
<CFIF isNumeric(myInstaAmount) AND isDate(myInstaDate) AND isNumeric(myInstaID)>
<!---proceed only if we have a good date and amount --->
<cfquery datasource="#REQUEST.USLAX
UPDATE PledgeInstallments
SET installDate = '#DateFormat(myInstaDate, 'mm/dd/yyyy')#',
installAmount = #myInstaAmount#
WHERE pledgeID = #session.myPledgeID# AND installID = #myInstaID#
</cfquery>
</CFIF>
</CFIF>
</CFLOOP>
<cfelse> <!---for Delete ID --->
<cfparam name="clickID" default="0">
<!--- Delete records --->
<CFIF LEFT(myind,6) eq "Delete">
<!---CFSET myDeleteID = Right(myInd,len(myInd)-4) />--->
<cfparam name="callerId" default="0">
<!--- delete the installment record checked
<CFIF isDefined("form.Delete#myI
<!---proceed only if we have a good date and amount --->
<cfquery datasource="#REQUEST.USLAX
update PledgeInstallments
set InstallDeleteDate = '#DateFormat(Now(), 'mm/dd/yyyy')#'
WHERE pledgeID = #session.myPledgeID# AND installID = #url.callerId#
</cfquery>
<!---</CFIF>--->
</CFIF>
<!--- Delete records <cfoutput>#callerId#</cfou
</cfif> <!--- for Delete ID --->
What is the value of cgi.request_method when you get this error?
ASKER
Are you asking 'post' or 'get'? It is 'post'.
You have changed this code since the error.
Where is the line that supposedly causes this error
<cfif not isdefined("form.fieldNames ")>
does not exist in your code.
Where is the line that supposedly causes this error
<cfif not isdefined("form.fieldNames
does not exist in your code.
ASKER
<cfif not isdefined("form.fieldNames ")>
and
<cfif isdefined("form.fieldNames ")>
retrun the same error.
and
<cfif isdefined("form.fieldNames
retrun the same error.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
That should work, you sure that line causes the problem?
Regards
Plucka