[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Error Resolving Parameter - Cannot figure out the problem

Posted on 2011-10-21
5
Medium Priority
?
262 Views
Last Modified: 2012-05-12
Hello,
  I am working on a registration form and upon testing I am receiving the following error:
Error Diagnostic Information
An error occurred while evaluating the expression:
#form.FirstName1#
Error near line 61, column 24.

I cannot seem to figure out why it's not working, I checked the spelling so I think it must be something simple that I am just missing.  This is what I have on the registration page and below is the code for the action page:
<form action="registration_action_new.cfm" method="post" name="registration_form"><!--- _action --->            
  <tr><td>
   
      <!---First User's name here--->
      <tr><td align="left">First Name</td>
        <td align="right"><input type="text" name="FirstName1" size="25" ></td>
        <td>Last Name</td>
        <td align="right"><input type="text" name="LastName1" size="25" ></td></tr>
        <tr><td></td></tr>
        <!---Second User's name here--->
        <tr><td><font><small>(additional authorized user)</small></font></td></tr>
       <tr><td></td></tr>
        <tr><td align="left"> First Name</td>
        <td align="right"><input type="text" name="FirstName2" size="25" ></td>
        <td>Last Name</td>
        <td align="right"><input type="text" name="LastName2" size="25" ></td>
        </tr>
        <tr><td></td></tr>
        <tr><td colspan="10"><hr /></td></tr>
        <!---Contact Information--->
        <tr><td><b>Contact Information</b></td></tr>
      <tr><td align="left">Address:</td>
        <td align="right"><input type="text" name="Address" size="25" ></td>
        </tr>
        <tr><td align="left">City:</td>
        <td align="right"><input type="text" name="City" size="25" ></td>
       
      <td align="left">State:</td>
        <td align="right"><input type="text" name="State" size="25" ></td>
       
        <td align="left">Zip Code:</td>
        <td ><input type="text" name="Zip" size="5" ></td>
        </tr>
      <tr><td align="left"> Email Address</td>
        <td align="right"><input type="email" name="Email" required="true" validate="email" message="Pleae provide a valid email address" size="25" ></td>
        </tr>          
         <tr>
        <td align="left">Phone</td>
        <td align="right"><input type="text" value="" name="PhoneNumber" size="25" ></td>
        </tr>
       

         
       
    <tr>
       <td> Transaction Type<form method="post" action="registration_action_new.cfm">
       <select size="1" name="transaction">
       <option value="purchase">Purchase</option>
       <option value="sell">Sell</option>
       </select>
       </form>
       
        </tr>
   
     
     
      </table>
                <!---Agent Selection --->
     <cfquery name="getAgents" datasource="teamportals">
                 Select LastName + ' ' + FirstName + ' ' + 'office ' + ' ' + Company AS Agent, Paynum, AssociateCell
              From tblUser
            Where Inactive = '0' AND Role ='agent'
            Order By LastName
                       
     </cfquery>
     Select Agent:&nbsp;&nbsp;  <cfform name="agentlookup" action="registration_action_new.cfm">
           <cfselect name="agentname" query="getAgents" value="Agent" display="Agent" required="yes" multiple="no" size="1" >
        </cfselect>
      <br /><br />
        <input type="submit" name="add_btn" value = "Submit">&nbsp;&nbsp;&nbsp;
        <input type="Reset" name="cancel_btn" value = "  Clear  ">
        </cfform>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	<title>Home Savings One Registration/Login</title>
</head>


<!---
loop over the past 7 days to get the week_ending value--->

<cfloop index="intOffset" from="0" to="7" step="1">
 
	<!--- Get the WEEKDAY that we want to show. --->
	<cfset dtDay = DateAdd( "d", -intOffset, Now() ) >
	
	<!---
	Output the full date so we can see BOTH the day
	of the week and the day-date.
	--->
	<cfset whichDay = '#DateFormat(dtDay, 'ddd')#'>
	
	<!--- grab the Sunday in the last seven days --->
	<cfif #DateFormat(dtDay, 'ddd')# IS 'Sun'>
		<cfset Myday = #DateFormat(dtDay, 'mm/dd/yy')#>
	</cfif>
	
	
</cfloop>


<!--- 	<cfoutput>#MyDay#</cfoutput> --->

<body leftmargin="0" marginheight="0" marginwidth="0" bottommargin="0" rightmargin="0" topmargin="0"
alink="993399" link="993399" vlink="black">
<table width="100%" border="0" cellpadding="0" cellspacing="0">


	
	<cfset date_added = CreateODBCDate(#dateformat(now(), 'mm/dd/yyyy')#)>
	
	<td valign="top">
    <img src="images/hs1_homeheader_new3.jpg" width="977" height="127" alt="header">

<table align="center">
<tr><td align="center" colspan="6" ><h3>Home Savings One Registration</h3></td></tr>
<tr><td align="center" colspan="6" class="td2a"><cfoutput> #DateFormat(date_added, 'mm/dd/yy')#</cfoutput></td></tr>
<tr><td>&nbsp;</td></tr>
	
	
	
<cfif parameterExists(form.add_btn)>

<cfoutput>

		<cfquery name="addUser" datasource="HSO">
			Insert Into	savings_card
            			(FName1,LName1,FName2,LName2,Address,City,State,Zip,Email,Phone,TransType,Agent,
                        AssociateCell,Affiliation,Rep,DateEntered)
            
            Values		('#form.FirstName1#','#form.LastName1#''#form.FirstName2#',
           				'#form.LastName2#','#form.Address#','#form.City#','#form.state#',
            			'#form.zip#','#form.email#','#form.PhoneNumber#','#form.transaction#',
            			'#form.agent#','#form.AssociateCell#','#form.affiliation#','#form.Rep#',
                        #date_added#)
         </cfquery>
 </cfoutput>
<!--Automated Email-->
 		<cfquery name="getLogin" datasource="HSO">
        	Select	CardNumber,FirstName1,LastName1,Email
            FROM	savings_card
            WHERE	Email='#form.email#'
        </cfquery>
  <cfoutput query="cardNumber">
  	<cfset registrant=#getLogin.FirstName1# + '' + #getLogin.Lastname1#>
    <cfset registrantEmail=#getLogin.email#>
    <cfset cardNumber=#getLogin.CardNumber#>
 </cfoutput>
 
 		<cfmail from="HSO@realestateone.com"
        to="#registrantEmail#"
        subject="Home Savings Registration Confirmation"
        type="html">
        Thank you for registering for your permanent Home Savings One card. You can go into the site to review the directory now (hyperlinked) or come back anytime and login using "#registrant#" with the password "#cardNumber#". Please look for your card to come in the mail within 2 weeks.

Home Savings Support Staff


        </cfmail>
        <br /><br />
        <cfoutput>Thank you for registering for your permanent Home Savings One card. You can go into the site to review the directory now (hyperlinked) or come back anytime and login using "#registrant#" with the password "#cardNumber#". This information will also be emailed to you. Please look for your card to come in the mail within 2 weeks.

Home Savings Support Staff


		</cfoutput>
        </cfif>



</body>
</html>

Open in new window

0
Comment
Question by:jdines
  • 3
  • 2
5 Comments
 
LVL 52

Expert Comment

by:_agx_
ID: 37007228
What's the full error message and when does it occur? When you submit the form?
0
 

Author Comment

by:jdines
ID: 37007497
Error occurred while processing request
An error occurred while evaluating the expression:
#form.firstname1#
Error near line 61 column 24

It occurs when I submit the custreg.cfm form
0
 
LVL 52

Accepted Solution

by:
_agx_ earned 2000 total points
ID: 37007592
       > <cfif parameterExists(form.add_btn)>

It's because you've got 2 forms with different fields, but the same button name.  So you end up running the same code for both forms.  

Give the buttons different names, so you can perform different actions based on which form was submitted.   Also, parameterExists is deprecated. Use structKeyExists or IsDefined instead.

<cfif structKeyExists(FORM, "nameOfButtonFromFirstForm")>
         process 1st form
<cfelseif structKeyExists(FORM, "nameOfButtonFromSecondForm")>
         process 2nd form
</cfif>
0
 

Author Closing Comment

by:jdines
ID: 37007965
Thanks your reply helped a great deal
0
 
LVL 52

Expert Comment

by:_agx_
ID: 37008152
Welcome :)
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how the fundamental information of how to create a table.
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question