Solved

Error on posting of form

Posted on 2003-12-05
5
188 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 250 total points
Comment Utility
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
Comment Utility
I should mention that the cfparam needs to exist before you try to use the ENABLE parameter.
0
 

Author Comment

by:aspguru28
Comment Utility
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
Comment Utility
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
Comment Utility
yup I put the CFPARAM tag at the top of the page and bingo.....it works.  Thanks ever so much!
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to set up the permalinks on a WordPress Website. 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 : Go t…

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now