Error on posting of form

Posted on 2003-12-05
Medium Priority
Last Modified: 2013-12-24
Hi Guys....I'm pretty new to coldfusion so I imagine this question will a piece of cake for some of you.  Here goes.

I have a form that processes orders and ultimately sends by coldfusion email.  I have a radio box <input type="radio" name="enable" value="agree">

When I send the form without checking the radio box it does not send and gives me the following error....

enable: #enable#
Name: #name#
Company: #company#
Address: #address#
Tel: #tel#
Email: #email#
Card Type: #card_type#
Name on card: #name_on_card#
Expiry: #expiry#
Card Number: #card_number#
Switch Issue Number: #switch_issue_number#

Error resolving parameter ENABLE

ColdFusion was unable to determine the value of the parameter. This problem is very likely due to the fact that either:

You have misspelled the parameter name, or
You have not specified a QUERY attribute for a CFOUTPUT, CFMAIL, or CFTABLE tag.

I'm not sure if the problem lies with coldfusion but wondered if you could advise?  Thanks!
Question by:aspguru28
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2

Accepted Solution

shooksm earned 1000 total points
ID: 9885122
The problem is on the Cold Fusion side.  Because HTML does not pass values for unused radio buttons, the ENABLE variable is not available to Cold Fusion.  You have a couple of choices.  You can use the IsDefined function to check to see if it exists before trying to use it, IE:

enable: <cfif IsDefined("enable")>#enable#<cfelse>disagree</cfif>

Or you can use the CFPARAM tag to define a default value for the parameter:

<cfparam default="disagree" name="enable">

Expert Comment

ID: 9885145
I should mention that the cfparam needs to exist before you try to use the ENABLE parameter.

Author Comment

ID: 9885342
I got a complilation error....not sure if I've constructed this correctly.  I don't have the option to use coldfusion in the action form only the page it posts to.

<cfparam default="disagree" name="enable">
enable: <cfif IsDefined("enable")>#enable#<cfelse>disagree</cfif>
Name: #name#

Expert Comment

ID: 9885394
Put the CFPARAM tag before your CFMAIL tag and you shouldn't need the CFIF tag so you should be able to just use:

enable: #enable#

Author Comment

ID: 9885489
yup I put the CFPARAM tag at the top of the page and bingo.....it works.  Thanks ever so much!

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

Most ColdFusion developers get confused between the CFSet, Duplicate, and Structcopy methods of copying a Structure, especially which one to use when. This Article will explain the differences in the approaches with examples; therefore, after readin…
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
Suggested Courses

762 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