Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic form value 1

Status
Not open for further replies.

aliashippysmom

Programmer
Jul 29, 2004
43
0
0
US
Hi! I do a database retrieval and load variables with the values like this:
Code:
<cfoutput query="get_data">
   <cfset "Oversight_#x#_#y#" = #Oversight#>
   <cfset "Program_#x#_#y#" = #Program_Operation#>
</cfoutput>
Variables x and y are columns in the database table.
I have a form with this:
Code:
<input <cfif #evaluate("Oversight_" & "#x#" & "_" & "#y#")# IS "yes">checked</cfif> value="yes" type="checkbox" name="oversight_#x#_#y#">
This works fine. I am having a problem with the input form to load a text input field.

Neither of these work:
Code:
<input value="#evaluate(""Delivery""_x_y)#" name="delivery_#x#_#y#" type="text" size="4">

<input value="#Other_" & "#evaluate(pa_id)#" & "_" & "#evaluate(spa_id)##" name="other_#pa_id#_#spa_id#" type="text" size="5">
Does this make sense and does anyone have any suggestions on how I can load the text input fields?

Thanks!
 
In all recent versions you can use array notation to both set and get the values

scopeName["variableName"]

Code:
<cfset variables["Delivery_"& x &"_"& y] = "some value">
<input value="#variables['Delivery_'& x &'_'& y]#" 
    name="delivery_#x#_#y#" type="text" size="4">
...or..
<input value="#variables['Delivery_#x#_#y#']#" 
       name="delivery_#x#_#y#" type="text" size="4">
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top