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?
JohnLucaniaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

PluckaCommented:
JohnLucania,

That should work, you sure that line causes the problem?

Regards
Plucka
0
JohnLucaniaAuthor Commented:
yes, it causes.
0
PluckaCommented:
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.
0
Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

JohnLucaniaAuthor Commented:
<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'&myInstaID)>
                              <CFSET myInstaDate = Evaluate('form.InDate'&myInstaID)>
                              --->

                              <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.USLAXDSN#" 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#myInstaID#")>--->
                              <!---proceed only if we have a good date and amount --->
                              <cfquery datasource="#REQUEST.USLAXDSN#" 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#</cfoutput> --->
</cfif>    <!---  for Delete ID --->
0
JeffHowdenCommented:
What is the value of cgi.request_method when you get this error?
0
JohnLucaniaAuthor Commented:
Are you asking 'post' or 'get'?  It is 'post'.
0
PluckaCommented:
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.
0
JohnLucaniaAuthor Commented:
<cfif not isdefined("form.fieldNames")>
and
<cfif isdefined("form.fieldNames")>
retrun the same error.
0
PluckaCommented:
No,

There has to be something your not showing us, paste the full error message perhaps.

<cfif isdefined("form.fieldNames")>  <!---for Delete ID --->
               <CFLOOP LIST="#form.fieldNames#" index="myInd">

Is not the same as

<cfif NOT isdefined("form.fieldNames")>  <!---for Delete ID --->
               <CFLOOP LIST="#form.fieldNames#" index="myInd">

as the second one would error on the <CFLOOP as form.fieldNames is not defined.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.