Solved

Dynamic form values using CFvariable

Posted on 2000-05-02
3
163 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
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

706 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

17 Experts available now in Live!

Get 1:1 Help Now