|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Creating a variable dynamically
How would one create a variable with the name pulled from a variable? For example, I have a user enter a form value and the text he/she enters is part of my variable name.
I've tried: <cfset #FORM.sampleText# = ""> <cfset evaluate("#FORM.sampleText#") = ""> I can't think of what to call this, limiting my search to find the answer. |
|
#2
|
||||
|
||||
|
<cfset "This#Form.whatever#Var"="">
That works. I would suggest using arrays though. |
|
#3
|
|||
|
|||
|
I believe this would work too:
<cfset "#FORM.sampleText#" = "">
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#4
|
|||
|
|||
|
This worked. Thanks!
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Creating a variable dynamically |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|