Solved

Dynamic form values using CFvariable

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
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 …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

790 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