Error on posting of form

Posted on 2003-12-05
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 250 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 works.  Thanks ever so much!

Featured Post

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Annoying "thing" blocks my view 4 144
javascript to html map 8 131
site launch date and last modified date 3 109
Adding multiple JVM environments to RedHat 6 7 80
Turn A Profile Picture Into A Cartoon Using Photoshop And Illustrator This tutorial will teach you how to make a cartoon style image out of a regular picture. I have tried to keep the tutorial as simple as possible. I used Adobe CS4 for this tuto…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. This will be demonstrated using a Windows 8 PC Go to your WordPress login page. This will look like the following: :…
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following:…

739 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