CF - Undefined form element

I can't see why the element GROW which is a form field is undefined when I am defining it with the EMAIL form field and it does not error out on EMAIL.

Any help is appreciated
<cfparam name="FORM.Email" default="">
<cfparam name="FORM.GROW" default="N">
<!--- Create an empty error string --->
<cfset strError = "">

<!--- If the form is submitted --->
<cfif isDefined("FORM.Submit")>
   <cfparam name="FORM.Email" default="">
   <cfparam name="FORM.GROW" default="N">
<!---    <cfset strError = ""> --->


      <cfset FORM.Email = Trim(FORM.Email)>
      <cfif Len(Trim(FORM.Email)) LT 1>
      <cfset strError = strError & "Please enter your Email!<br>">
      </cfif>
       
      <cfif not len(strError)>    
         <CFQUERY NAME="GetEmail" DATASOURCE="HotBanana">
           SELECT  Email, GROW
           FROM    table
           WHERE email = <CFQUERYPARAM VALUE="#FORM.EMAIL#" CFSQLTYPE="CF_SQL_VARCHAR">
        </CFQUERY>

        <cfif GetEmail.recordcount GT 0>
          <cfset strError = strError & "That email is already registered <br>to receive the newsletter<br>">
        <cfelse>
           <cfquery  NAME="Added" datasource="HotBanana">
            INSERT INTO table (Email,GROW)
            VALUES ('#FORM.Email#','#FORM.GROW#')
            </cfquery>
           <cfset strError = "Added to the newsletter<br>">  
<body>
<p><cfform action="data_entry_form.cfm" method="post"> 
		<table width="400" border="0" cellspacing="0" cellpadding="3"> 
			<!--- Add table row to show error message ---> 
			<tr> 
				<td colspan="2"><cfif len(strError)>
  <div style="position:relative;left:5px; top:2px;padding:10px; background-color:#FFFFFF;width:250px;color:maroon;text-align:right;">
 <cfoutput>#strError#</cfoutput>
 </div>
</cfif></td> 
		  </tr> 
           	   
            <tr> 
				<td><h2 class="style1">Email:</h2></td> 
				<td> 
					<!--- Email textfield - REQUIRED ---> 
					<cfinput 
					type="text" 
					name="Email" 
					size="30"></td> 
			<td><h2 class="style1">GROW:</h2></td> 
            <td>
			 <cfselect name="GROW">
          <option value='Y' <cfif GetEmail.GROW EQ 'Y'>selected="selected"</cfif> >Yes</option>
          <option value='N' <cfif GetEmail.GROW NEQ 'Y'>selected="selected"</cfif> >No</option>
             </cfselect>
          
</td>

Open in new window

JohnMac328Asked:
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.

JohnMac328Author Commented:
It starts to bomb on line 56
duncancummingCommented:
If it's line 56, the problem isn't Form.Grow, it's GetEmail.GROW.  You're referring to GetEmail inside the part of the IF statement where there is no recordcount for the GetEmail query.

Try referring to Form.Grow instead and you might be fine:

<cfselect name="GROW">
	<option value='Y' <cfif Form.GROW EQ 'Y'>selected="selected"</cfif> >Yes</option>
	<option value='N' <cfif Form.GROW NEQ 'Y'>selected="selected"</cfif> >No</option>
</cfselect>

Open in new window

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
Pravin AsarPrincipal Systems EngineerCommented:

Looks like you are on your way to solution.

In future to debug similar issues you may

<cfoutput>#form.fieldnames#</cfoutput>

or

<cfdump var="#form#">

No points please.
JohnMac328Author Commented:
Great thanks
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 Development Software

From novice to tech pro — start learning today.