[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Error on posting of form

Posted on 2003-12-05
5
Medium Priority
?
196 Views
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!
0
Comment
Question by:aspguru28
  • 3
  • 2
5 Comments
 
LVL 9

Accepted Solution

by:
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">
0
 
LVL 9

Expert Comment

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

Author Comment

by:aspguru28
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#
0
 
LVL 9

Expert Comment

by:shooksm
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#
0
 

Author Comment

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

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
What You Need to Know when Searching for a Webhost Provider
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: mywebsite.com/wp-login.php :…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…
Suggested Courses

831 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