I can output the value of the session vars like so:
cfloop query=memberInfoFields
cfoutput#session.memberRegister[STRFIELDNAME]#br/cfoutput
but this is not working correctly:
cfloop query=memberInfoFields
input type=text name=#STRFIELDNAME#
value=#session.memberRegister[STRFIELDNAME]# size=30
Is it possible the value of those keys is actually blank? In previous code you
were setting the default value to .
Output the value before the inputs. What do you see?
cfoutput
cfloop query=memberInfoFields
Debug value of #STRFIELDNAME# = #session.memberRegister[STRFIELDNAME]#
input
I get the results when I user your code
Debug value of strInstUsername =
Debug value of strLanguage =
Debug value of strInstEmail = m...@aol.com
Debug value of strGender = Female
Debug value of strDegrees = Associate Degree
Debug value of strEmployeeNum =
Debug value of strDepartment =
Debug
I figured it out:
I had code that was resetting the values:
cfif NOT isDefined(session.memberRegister.STRFIELDNAME)
cfset session.memberRegister.#STRFIELDNAME# =
/cfif
On Sat, Oct 30, 2010 at 3:24 PM, Monique Boea moniqueb...@gmail.com wrote:
I get the results when I user your
cfset session.memberRegister.#STRFIELDNAME# =
Good job.
BTW: Consider using associative array notation, it is easier on the eyes ;-)
~|
Order the Adobe Coldfusion Anthology now!
Hello
I have a multi step form that is being submitted to itself.
I create a structure session.memberRegister and then append to the structure
as each form is submitted like so:
cfscript
session.memberRegister = structnew();
/cfscript
cfset
I got this to work.
DUH!!
cfloop query=memberInfoFields
!--- create dynamic session vars ---
cfif NOT isDefined(session.memberRegister.STRFIELDNAME)
cfset session.memberRegister.#STRFIELDNAME# =
/cfif
On Fri, Oct 29, 2010 at 9:38 AM, Monique Boea moniqueb...@gmail.com wrote:
Hello
I
cfset
StructAppend(session['memberRegister'],STRFIELDNAME)
StructAppend, appends the contents of one structure onto another. STRFIELDNAME
looks like a simple value. If you are trying to create a dynamic key, just use
array notation
ie
cfset session.memberRegister[STRFIELDNAME] =
Thanks Leigh.
Now, how do I check for the existance of and use these dynamic variables to
set my form values?
Like so: cfif #session.memberRegister.strCME# EQ
medicalselected=selected/cfif
But I need to use dynamic variable names.
I am trying to use this but it is not working:
Now, how do I check for the existance of and use these
dynamic variables to
set my form values?
The same way as before. Use array notation. No need for the extra # signs.
ie
cfif session.memberRegister[ STRFIELDNAME ] eq someValue
something here...
/cfif
BTW: Most scopes in CF are
Now, how do I check for the existance
value=#Evaluate(session.memberRegister.#STRFIELDNAME#)#
BTW: I ignored the check for existence comment because your code seemed to be
getting the value instead. But if you really do mean existence, then use
structKeyExists or IsDefined.
11 matches
Mail list logo