troubleshooting Question

Element is undefined in FORM

Avatar of Shawn
ShawnFlag for Canada asked on
Web Servers
17 Comments1 Solution998 ViewsLast Modified:
hi,

I am setting up a form that keeps throwing the error "Element is undefined in FORM " once I click on send. Not sure why this is since I set up <cfparam name="form.Title" default=""> at the beginning of the form.

I should mention that I have 2 pages 1. dsp_ to display and an act_ to send us an email if mandatory fields are filled...otherwise it resubmits to itself.

I copied this from another part or our site which works fine.

dsp_translation_test_english.cfm
contains
 
 
 
<cfparam name="form.Title" default="">
<cfparam name="Form.Tr" default="">
<cfparam name="form.Testtext" default="">
<cfparam name="form.Source" default="">
<cfparam name="form.Target" default="">
<cfparam name="form.SourceCurrencyRate" default="">
<cfparam name="form.SourceCurrency" default="">
<cfparam name="form.TranslatorType" default="">
<cfparam name="form.LastName" default="">
<cfparam name="form.FirstName" default="">
<cfparam name="form.email" default="">
<cfparam name="form.company" default="">
<cfparam name="form.Country" default="">
<cfparam name="form.Telephone" default="">
<cfparam name="form.TranslatorStatus" default="">
<cfparam name="form.TranslatorsDiploma" default="">
<cfparam name="form.YearTranslationDiplomaObtained" default="">
<cfparam name="form.YearsTranslating" default="">
<cfparam name="form.CatTool" default="">
<cfparam name="form.CatToolOther" default="">
<cfparam name="form.otherinfo" default="">
 
 
<cfif isdefined('form.fullmessage')> 
<p><font color="#FF0000"><strong><cfoutput>#fullmessage#</cfoutput></strong></font></p>
</cfif>
 
 
<p>&nbsp;</p>
<p>Welcome to Araxi's translation test area. </p>
            <Cfoutput> 
<FORM action=index.cfm?action=home.ttest-act method=post enctype="multipart/form-data" name="form">
 
    <p> 
      <input type="Hidden" name="FORMTYPE" value="TranslationTest">
      <cfinclude template="cfformprotect/cffp.cfm">
    </P>
      
    <table valign="top" class="submenu"width="90%" border="0" cellspacing="0" cellpadding="5">
      <tr> 
        <td height="20" colspan="4" bordercolor="98012E" bgcolor="98012E" class="menu">
<div align="center"><font color="##FFFFFF">Translation 
            Test </font></div></td>
      </tr>
      <tr> 
        <td colspan="2" valign="top"><p>Job Reference*</p>
          </td>
        <td colspan="2" valign="top"><p> 
            
			<cfif FORM.Tr NEQ "">
              #Tr# <span class="smallbodytext">(to change the reference</span> 
              <a href="<cfoutput>#script_name#?action=home.ttest</cfoutput>" >click 
              here</a><span class="smallbodytext">)</span> 
              <cfelse>
              <INPUT name="Tr" class=formcell id="Tr"  value=''size=10 maxLength=5>
            </cfif>
          </p>
          </td>
      </tr>
      <tr>
        <td colspan="2" valign="top">Title</td>
        <td colspan="2" valign="top">Architect comments for client</td>
      </tr>
      <tr> 
        <td colspan="2" valign="top"> <p>Job description and instructions</p>
          <p>&nbsp;</p>
          <p>&nbsp;</p></td>
        <td colspan="2" valign="top">goes here</td>
      </tr>
      <tr> 
        <td colspan="2" valign="top"><p>Test text</p></td>
        <td colspan="2" valign="top" bordercolor="98012E"> <table width="100%" border="1" valign="top" cellpadding="0" cellspacing="0" bordercolor="98012E">
            <tr> 
              <td>this is the test text</td>
            </tr>
          </table>
          <p>&nbsp;</p>
          </td>
      </tr>
      <tr> 
        <td colspan="2"><strong>Your Translation</strong><br>
          <span class="smallbodytext">please be sure you have proofed and done 
          a spell check. (stangely this is often overlooked for &quot;quick&quot; 
          tests)</span></td>
        <td colspan="2"><TEXTAREA class=formcell name=Testtext rows=5 cols=50></TEXTAREA></td>
      </tr>
      <tr> 
        <td colspan="2">&nbsp;</td>
        <td colspan="2">&nbsp;</td>
      </tr>
      <tr> 
        <td colspan="2"><p>Source language 
            <select name="Source" size="1" class=formcell id="Source" >
              <cfif isdefined ("form.Source")>
                <cfloop query="getSLang">
                  <option value='#getSLang.Slang#' <cfif getSLang.Slang eq form.Source>selected="true"</cfif>>#getSLang.Slang#</option>
                </cfloop>
                <cfelse>
                <option>- select -</option>
                <cfloop query="getSLang">
                  <option value='#getSLang.Slang#'>#getSLang.Slang#</option>
                </cfloop>
              </cfif>
            </select>
          </p></td>
        <td colspan="2">Target language 
          <select name="Target" size="1" class=formcell id="Target" >
            <cfif isdefined ("form.Target")>
              <cfloop query="getTLang">
                <option value='#getTLang.Tlang#' <cfif getTLang.Tlang eq form.Target>selected="true"</cfif>>#getTLang.Tlang#</option>
              </cfloop>
              <cfelse>
              <option>- select -</option>
              <cfloop query="getTLang">
                <option value='#getTLang.Tlang#'>#getTLang.Tlang#</option>
              </cfloop>
            </cfif>
          </select> </td>
      </tr>
      <tr> 
        <td colspan="2">Your source rate for the job*</td>
        <td colspan="2"><INPUT name=SourceCurrencyRate class=formcell id=SourceCurrencyRate  size=5 
                        maxLength=5> <select name="SourceCurrency" size="1" class=formcell id="SourceCurrency" >
            <option value="USD">USD</option>
            <option value="CAD">CAD</option>
            <option value="EUR">EUR</option>
            <option value="GBP">GBP</option>
          </select></td>
      </tr>
      <tr> 
        <td height="20" bgcolor="98012E" class="menu" colspan="4"><div align="center"><font color="##FFFFFF">About 
            You </font></div></td>
      </tr>
      <tr bgcolor="##FFFFCC" class="submenuparentlink"> 
        <td valign="bottom">
		<input type="radio" name="Title" value="Mrs" id="Title" >
          Mrs 
        <input type="radio" name="Title" value="Ms" id="Title">
          Ms 
        <input type="radio" name="Title" value="M" id="Title">
          Mr </td>
        <td>&nbsp;</td>
        <td><p> 
            <input type="radio" name="TranslatorType" value="Independant" id="TranslatorType" >
            Independant <br>
            <input type="radio" name="TranslatorType" value="Group of translators" id="TranslatorType" >
            Group of translators <br>
            <input type="radio" name="TranslatorType" value="Translation Agency" id="TranslatorType" >
            Translation Agency </p></td>
        <td><p><br>
            <br>
          </p></td>
      </tr>
      <tr bgcolor="##FFFFCC"> 
        <td>Name*</td>
        <td> <INPUT name=LastName class=formcell id=LastName3  size=15 
                        maxLength=30></td>
        <td>Company</td>
        <td> <INPUT class=formcell id=company maxLength=30 
                        size=15 name=company></td>
      </tr>
      <tr bgcolor="##FFFFCC"> 
        <TD align="left"> <DIV align=left>First name</DIV></TD>
        <TD align="left" > <INPUT class=formcell id=FirstName 
                        maxLength=30 size=15 name=FirstName></TD>
        <TD align="left">Country*</TD>
        <TD align="left"> <DIV align=left> 
            <INPUT class=formcell id=Country 
                        maxLength=30 size=15 name=Country>
          </DIV></TD>
      </tr>
      <tr bgcolor="##FFFFCC"> 
        <TD align="left"> <DIV align=left> 
            <p>email*</p>
          </DIV></TD>
        <TD align="left" > <INPUT name=email class=formcell id=email  size=15 
                        maxLength=30> </TD>
        <TD align="left">Phone</TD>
        <TD align="left"> <DIV align=left> 
            <INPUT class=formcell maxLength=30 
                        size=15 name=Telephone>
          </DIV></TD>
      </tr>
      <tr bgcolor="##FFFFCC"> 
        <TD colspan="2" align="left">Do you have a translator's diploma? </TD>
        <TD colspan="2" align="left"><input type="radio" name="TranslatorsDiploma" value="true" id="TranslatorsDiploma" >
          yes 
          <input type="radio" name="TranslatorsDiploma" value="false" id="TranslatorsDiploma" >
          no. If yes, year obtained 
          <INPUT name=YearTranslationDiplomaObtained class=formcell id=YearTranslationDiplomaObtained4  size=4 
                        maxLength=4></TD>
      </tr>
      <tr bgcolor="##FFFFCC"> 
        <TD colspan="2" align="left">You translate </TD>
        <TD colspan="2" align="left"><input type="radio" name="TranslatorStatus" value="Full Time" id="TranslatorStatus" >
          full time 
          <input type="radio" name="TranslatorStatus" value="Part Time" id="TranslatorStatus" >
          part time </TD>
      </tr>
      <tr bgcolor="##FFFFCC"> 
        <TD colspan="2" align="left">Number of years translating</TD>
        <TD align="left"> <INPUT name=YearsTranslating class=formcell id=YearsTranslating3  size=2 
                        maxLength=2></TD>
        <TD align="left">&nbsp;</TD>
      </tr>
      <tr bgcolor="##FFFFCC"> 
        <TD align="left">CAT tools used: </TD>
        <TD align="left" ><br> </TD>
        <TD align="left" valign="top"> <input name="CatTool" type="checkbox" id="CatTool4" value="Deja Vu">
          D&eacute;j&agrave; Vu<br> <input name="CatTool" type="checkbox" id="CatTool4" value="Trados">
          Trados<br>
          Other 
          <INPUT name=CatToolOther class=formcell id=CatToolOther  size=15 
                        maxLength=30></TD>
        <TD align="left" valign="top"> <input name="CatTool2" type="checkbox" id="CatTool5" value="Wordfast">
          Wordfast<br> <input name="CatTool2" type="checkbox" id="CatTool5" value="OmegaT">
          OmegaT</TD>
      </tr>
      <tr bgcolor="##FFFFCC"> 
        <TD align="left">Your R&eacute;sum&eacute; or Profile</TD>
        <TD align="left" >&nbsp;</TD>
        <TD colspan="2" align="left"><input name="FILE" type="file" class=formcell id="FILE3"></TD>
      </tr>
      <tr bgcolor="##FFFFCC"> 
        <TD colspan="2" align="left">Other information you wish to give us<br> 
          <span class="smallbodytext"><font class="smalltext">(if you specialise 
          in any areas please specify)</font></span></TD>
        <TD colspan="2" align="left"><TEXTAREA class=formcell name=otherinfo rows=5 cols=50></TEXTAREA></TD>
      </tr>
      <tr bgcolor="##FFFFCC"> 
        <td colspan="4"> <table width="100%" cellspacing="0" cellpadding="0">
            <tr> 
              <td class="heading_RED"><p>*mandatory fields</p></td>
              <td align="right"> <INPUT class=button type=submit value=Send name=save> 
              </td>
            </tr>
          </table></td>
      </tr>
    </table>
	
    <p>&nbsp;</p>
    <p>&nbsp; </p>
    
      
    <P align=left class="bodytext">Please</P>
    </TD></TR><TR><TD class=bodytext vAlign="top" >&nbsp;</TD></TR></TABLE>
 
    </FORM>
	</CFOUTPUT> 
 
act_translation_test_english.cfm
contains
 
 
<cfif isdefined('form.save')>
 
	<cfset continue = true>
   <cfif FORM.Tr EQ "">
    <cfset form.msg1 = " The TestReference field is mandatory.<br>">
    <cfset continue = false>
	<cfelse>
	<cfset form.msg1 = "">
  </cfif>
  
  <cfif not REFindNocase("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*\.(([a-z]{2,3})|(aero|coop|info|museum|name))$", FORM.email)>
     <cfset form.msg2 = " A valid E-MAIL address is mandatory.<br>">
    <cfset continue = false>
	<cfelse>
	<cfset form.msg2 = "">
  </cfif>
  
    <cfif FORM.LastName EQ "">
    <cfset form.msg3 = " Your Name is mandatory.<br>">
    <cfset continue = false>
	<cfelse>
	<cfset form.msg3 = "">
  	</cfif>
	
   <cfif FORM.Country EQ "">
    <cfset form.msg4 = " Your Country is mandatory.<br>">
    <cfset continue = false>
	<cfelse>
	<cfset form.msg4 = "">
	</cfif>
	
   <cfif FORM.SourceCurrencyRate EQ "">
    <cfset form.msg5 = " Your Rate is mandatory.<br>">
    <cfset continue = false>
	<cfelse>
	<cfset form.msg5 = "">
  	</cfif>
	<cfelse>
	<cfset form.msg5 = "">
	</cfif>
	
  
  <cfset form.fullmessage = form.msg1 & form.msg2 & form.msg3 & form.msg4 & form.msg5>
    
   <cfif continue EQ false>      
 
<cfset Title = FORM.Title>
<cfset Tr = FORM.Tr>
<cfset Testtext = FORM.Testtext>
<cfset Source = FORM.Source>
<cfset Target = FORM.Target>  
<cfset SourceCurrencyRate = FORM.SourceCurrencyRate>
<cfset SourceCurrency = FORM.SourceCurrency>
<cfset TranslatorType = FORM.TranslatorType>
<cfset LastName = FORM.LastName>  
<cfset FirstName = FORM.FirstName>
<cfset email = FORM.email>
<cfset company = FORM.company>
<cfset Country = FORM.Country>
<cfset Telephone = FORM.Telephone>  
<cfset TranslatorStatus = FORM.TranslatorStatus>
<cfset TranslatorsDiploma = FORM.TranslatorsDiploma>
<cfset YearTranslationDiplomaObtained = FORM.YearTranslationDiplomaObtained>
<cfset YearsTranslating = FORM.YearsTranslating>  
<cfset CatTool = FORM.CatTool>
<cfset CatToolOther = FORM.CatToolOther>
<cfset otherinfo = FORM.otherinfo>  
 
	  
<cfinclude template="dsp_translation_test_#request.language#.cfm">
<cfelse>
 
<cfset Cffp = CreateObject("component","cfformprotect.cffpVerify").init() />
<!--- now we can test the form submission --->
	   <cfdump var=#cffp.testSubmission(form)# />
	   results here
	   <cfdump var=#form#>
 
<cfif Cffp.testSubmission(form)>
       <!--- The submission has passed the form test.  Place processing here --->
 
 
 <!--- email to us giving name of person referring and contacts --->
<cfmail to="webform@araxi.fr" from="website@araxi.fr" subject="translation test. Ref.: #form.TestReference#" type="HTML">
<p>Title: #form.Title#</p> 
<p>TestReference: #form.TestReference#</p>
<p>Testtext: #form.Testtext#</p>
<p>Source: #form.Source#</p>
<p>Target: #form.Target#</p>
<p>SourceCurrencyRate: #form.SourceCurrencyRate#</p>
<p>SourceCurrency: #form.SourceCurrency#</p>
<p>TranslatorType: #form.TranslatorType#</p> 
<p>LastName: #form.LastName#</p> 
<p>FirstName: #form.FirstName#</p> 
<p>email: #form.email#</p> 
<p>company: #form.company#</p> 
<p>Country: #form.Country#</p> 
<p>Telephone: #form.Telephone#</p> 
<p>TranslatorStatus: #form.TranslatorStatus#</p> 
<p>TranslatorsDiploma: #form.TranslatorsDiploma#</p> 
<p>YearTranslationDiplomaObtained: #form.YearTranslationDiplomaObtained#</p> 
<p>YearsTranslating: #form.YearsTranslating#</p> 
<p>CatTool: #form.CatTool#</p> 
<p>CatToolOther: #form.CatToolOther#</p> 
<p>otherinfo: #form.otherinfo#</p> 
 
 
<br>
</cfmail>
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 17 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 17 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros