Question

Element is undefined in FORM

Asked by: Shawnaraxi

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>

                                  
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:
237:
238:
239:
240:
241:
242:
243:
244:
245:
246:
247:
248:
249:
250:
251:
252:
253:
254:
255:
256:
257:
258:
259:
260:
261:
262:
263:
264:
265:
266:
267:
268:
269:
270:
271:
272:
273:
274:
275:
276:
277:
278:
279:
280:
281:
282:
283:
284:
285:
286:
287:
288:
289:
290:
291:
292:
293:
294:
295:
296:
297:
298:
299:
300:
301:
302:
303:
304:
305:
306:
307:
308:
309:
310:
311:
312:
313:
314:
315:
316:
317:
318:
319:
320:
321:
322:
323:
324:
325:
326:
327:
328:
329:
330:
331:
332:
333:
334:
335:
336:
337:
338:
339:
340:
341:
342:
343:
344:
345:
346:
347:
348:
349:
350:
351:
352:
353:
354:
355:
356:
357:
358:
359:
360:
361:
362:
363:
364:
365:
366:
367:
368:

Select allOpen in new window

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-03-12 at 15:28:23ID24225995
Topic

ColdFusion Application Server

Participating Experts
2
Points
500
Comments
17

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. 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.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Element Undefined
    I'm at a loss of what I'm doing wrong. Here is the query: <cfquery datasource="film" name="qCourses"> SELECT GuideSheets.CrsPrefix, GuideSheets.CrsNo, ActiveCourses.CrsTitle, Semester.SemesterDescription, Programs.ProgramDescription, Programs.Act...
  2. Undefined
    I can't figure out why the following function keeps returning undefined // retrieve a form name from an object function getFormName( obj ) { var parent = obj.parentElement; if ( parent.tagName == 'FORM') { var formName = parent.getAttribute('name'); return formName...
  3. Element is undefined in FORM.
    Is this wrong? <td width="295"> <input name="tdyTerm" type="radio" value="Yes" <cfif #SESSION.HLS.tdyTerm# EQ form.tdyTerm#>checked</cfif>> Yes &nbsp; <input name="tdyTerm"...
  4. 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?
  5. Element USER_ID is undefined in SESSION.
    Hello experts. When i logout i have this error: Element USER_ID is undefined in SESSION. Any help? The page is like this

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: _agx_Posted on 2009-03-12 at 16:10:41ID: 23874706

> since I set up <cfparam name="form.Title" default=""> at the beginning of the form

   Yes, but that is on the "dsp_translation_test_english.cfm" page.  From what I can see there are
   no cfparam's on the action page   So "form.title" would be undefined if none of the radio buttons
   are checked.


> <FORM action=index.cfm?action=home.ttest-act method=post en

   Are you posting the form data directly to the action page ("act_translation_test_english.cfm")?

 

by: ShawnaraxiPosted on 2009-03-12 at 16:20:40ID: 23874755

>In the other form that works on the site it is done this way as well. I think this should be ok.

>Are you posting the form data directly to the action page ("act_translation_test_english.cfm")?
yes

 

by: _agx_Posted on 2009-03-12 at 16:24:58ID: 23874780

You have to add the cfparam's on the action page as well.  

Checkboxes and radio buttons do not exist unless they're checked.  None of the "Title" buttons are checked by default. So if the user submits the form that way, "form.Title" will be undefined.  So you have to set a default on the action page to prevent that error (or use IsDefined before accessing it).

 

by: _agx_Posted on 2009-03-12 at 16:27:01ID: 23874793

> >Are you posting the form data directly to the action page ("act_translation_test_english.cfm")?
> yes

I ask because that is not what your sample code says.  The action = index.cfm?action=home.ttest-act .

 

by: ShawnaraxiPosted on 2009-03-12 at 16:32:03ID: 23874827

oh, I have another page that sets these...

<cfelseif REQaction is "ttest">
<cfinclude template="dsp_translation_test_#request.language#.cfm">

<cfelseif REQaction is "ttest-act">
<cfinclude template="act_translation_test_#request.language#.cfm">

 

by: _agx_Posted on 2009-03-12 at 16:34:43ID: 23874848

Oh, okay.   That should work since you are using <cfinclude...>'s.

But you still have to use cfparam for the checkboxes and radio buttons.  Like I said, they do not exist on the action page unless they're checked.  So if nothing is checked .. and you don't set a default ... you get the "Element undefined..." error.   Make sense?

 

by: ShawnaraxiPosted on 2009-03-12 at 16:42:39ID: 23874895

but I do set it in the act_ page when in the line
<cfset Title = FORM.Title>

 

by: ShawnaraxiPosted on 2009-03-12 at 16:45:03ID: 23874906

here are 2 set of files. One set you have the dsp and act for this example translation_test.
The other is a very similar one called sponsor which works. If you look at the example of title it is pretty much the same.

 

by: _agx_Posted on 2009-03-12 at 16:51:14ID: 23874949

> but I do set it in the act_ page when in the line
> <cfset Title = FORM.Title>

No, that is not actually setting a default.  What it does is try to use the form.title variable when it does not exist. That is why you are getting an error.  Only CFPARAM sets a default value the field does not exist.

Add a CFPARAM to you action page code, then it will work:
<cfparam name="form.title" default="use this value if it is not defined">
....
<cfset Title = FORM.Title>

 

by: ShawnaraxiPosted on 2009-03-12 at 16:54:00ID: 23874967

ok, I see your logic.

Could you have a quick look at the other files. I'm really curious to know why it worked in that case.

 

by: trailblazzyr55Posted on 2009-03-12 at 16:55:27ID: 23874975

This may be a "given", however perhaps worth a mention...

I would recommend setting <cfdump>'s in various locations where you'd expect the form values to exist, you should see a key "fieldnames" if you dump the form scope, and from there you can see exactly what is making it to where you want. Also it'll give you a pretty good indication as to if you're running the template/page you'd expect. Then "walk" the dumps back to the specific problematic location.

If you don't already have debugging turned on I would turn it on and follow the stack trace so you can see the flow of the request and where actions are being performed. This should significantly help you narrow your search to the location where you need to make a fix.

Its hard to help identify where your fields are getting lost without following the flow of your application, however I'd start where the error is occurring and place several dumps in between to get an idea of whats going on at each stage of the request. If you're working on a live site for whatever reason you can wrap it in a condition such as the one below so that you're the only one seeing the dumps...

<cfif CGI.REMOTE_ADDR eq "your ip address here">
 <cfdump var="#form#">
</cfif>

if you're not sure of your IP address, visit: http://whatismyipaddress.com/

 

by: _agx_Posted on 2009-03-12 at 17:03:01ID: 23875019

> I'm really curious to know why it worked in that case.

It is because one of those radio buttons is "checked" by default.  Since something is checked .. that field exists on the action page.

    <input type="radio" name="Title" value="Mme" id="Title" <cfif (#form.Title# EQ "Mme")>checked</cfif>

Also, trailblazzyr55's makes a good suggestion.  Another good starting point with forms is to dump the entire FORM scope at the top of the page. See what fields _were_ passed, and then work from there.

 

by: ShawnaraxiPosted on 2009-03-12 at 17:06:11ID: 23875035

<input type="radio" name="Title" value="Mme" id="Title" <cfif (#form.Title# EQ "Mme")>checked</cfif>

correct me if I'm wrong (need a coffee I think) but this line has no default check. It will however be checked if #form.Title# EQ "Mme"....when I submit the form with nothing checked it still passes.

 

by: _agx_Posted on 2009-03-12 at 17:08:17ID: 23875055

> It is because one of those radio buttons is "checked" by default.

Correction.  I take that back.  After looking at the form more closely, it seems like the reason is you may not be using "form.title" on the other action page.

 

by: _agx_Posted on 2009-03-12 at 17:09:24ID: 23875059

> correct me if I'm wrong

Nope. You are correct.  I looked closer at the sponsor action page and can't see a reference to "form.title". If it is not used, that would explain why the error doesn't occur.

 

by: ShawnaraxiPosted on 2009-03-12 at 17:21:06ID: 23875118

wow, never noticed that. good eye.

and you're right. As soon as I put

<cfparam name="form.title" default="use this value if it is not defined">

the error went away. thanks!

I just posted another question regarding a field in the same form...maybe you could help there too
http://www.experts-exchange.com/index.jsp?qid=24226247

 

by: ShawnaraxiPosted on 2009-03-12 at 17:23:15ID: 23875129

thanks for the pointers trailblazzyr55:.
I do have it debugging turned on but hadn't before used the <cfdump> before. That will surely save a lot of time in the future. thanks

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...