Solved

Dynamic form values using CFvariable

Posted on 2000-05-02
3
171 Views
Last Modified: 2013-12-24

I am creating a form with 6 names and 30 different values.  I will use this form to tally votes to a particular question.  Currently I have created a cfquery that works within the Query Builder but not when using the form.  The Database will be driven by the ID value and then increase the corresponding vote section by 1.

I need to have the CFvariable select the value statement of the radio button and then run the cfquery stated below.


Relationship
Form value   Database ID     # of Votes
1            1               0        
2            2               0
3            3               0




<cfquery name="voteupdate" datasource="msurvey" dbtype="ODBC">
UPDATE totals SET totals.Votes = [Votes]+1
WHERE       (totals.ID = #CFvariable#);

</cfquery>



Error Diagnostic Information
Error resolving parameter CFVARIABLE
Cold Fusion was unable to determine the value of the parameter. This problem is very likely due to the fact that either:
1.      You have misspelled the parameter name, or
2.      You have not specified a QUERY attribute for a CFOUTPUT, CFMAIL, or CFTABLE tag.
The error occurred while evaluating the expression:
#CFvariable#
The error occurred while processing an element with a general identifier of (#CFvariable#), occupying document position (3:32) to (3:43).
0
Comment
Question by:smelt
[X]
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 Comments
 
LVL 2

Expert Comment

by:paulkd
ID: 2771145
CFVariable hasn't been assigned a value. Is VFVariable the result of a form variables - e.g. <CFSET CFVariable=Form.RadioXValue>

P.S. I haven't been able to understand what your attempting to accomplish (but this is normal for me) - could you post the form code?
0
 
LVL 1

Accepted Solution

by:
cfmrulez earned 200 total points
ID: 2771275
If I have understood, you want to put in #CFVariable# the value of the radio button selected, no?

You're accesing the bad way to the variable. The correct form is, supposing your radio button name property set to "radio_value", this:

<cfquery name="voteupdate" datasource="msurvey">
update totals
set totals.Votes = [Votes] + 1
where (totals.ID = #form.radio_value#)</cfquery>

If #form.radio_value# is a number, if not, you must put the ' before and after the variable.

Hope this helps,
cfmrulez!





0
 

Author Comment

by:smelt
ID: 2773215
Works great!  Thanx
0

Featured Post

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

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.
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

710 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