>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_eng
yes
Main Topics
Browse All Topicshi,
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.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
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.
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.
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.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
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.
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).
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?
> 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>
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.c
> 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.
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-exchang
Business Accounts
Answer for Membership
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
ish.cfm" page. From what I can see there are
me.ttest-a ct method=post en
lish.cfm") ?
Yes, but that is on the "dsp_translation_test_engl
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=ho
Are you posting the form data directly to the action page ("act_translation_test_eng