<cfset session.stCreatAcct = StructNew()>
<cfset session.stCreatAcct.FName = "#form.fname#">
<cfset session.stCreatAcct.LName = "#form.lname#">
put the session. on the front of the variable.
And then in the other template I can do this: <cfset Variables.foo =
"#session.stCreatAcct.foo#">
no need to, but you could, since you can reference the variable
as session.stCreatAcct.foo if you wanted to. but, in the sense of only
locking once, yeah, do that.
....tony
tony weeg
[EMAIL PROTECTED]
www.revolutionwebdesign.com
rEvOlUtIoN wEb DeSiGn
410.334.6331
-----Original Message-----
From: Lola Lee [mailto:[EMAIL PROTECTED]
Sent: Saturday, December 13, 2003 4:51 PM
To: CF-Talk
Subject: RE: Structure Question
Let me see if I understand this . . . It's possible to do this:
<cfset session.stCreatAcct = StructNew()>
<cfset stCreatAcct.session.FName = "#form.fname#">
<cfset stCreatAcct.session.LName = "#form.lname#">
And then in the other template I can do this: <cfset Variables.foo =
"#session.stCreatAcct.foo#">
At 2:34 PM -0500 12/13/03, Tony Weeg wrote:
>put the structure in a persistent scope, session for instance.
>
>instead of variables.foo
>use session.foo.
>
>but be sure to cflock it, if race conditions could occur.
>
>....tony
>From: Lola Lee [mailto:[EMAIL PROTECTED]
>Sent: Saturday, December 13, 2003 1:18 PM
>To: CF-Talk
>Subject: Structure Question
>
>
>I have a project, where I'm trying to set up a page for creating an
user
>account. And then validate before inserting into database. I have the
>form fields set up as Variables.foo in the main template, as such:
>
><cfif Len(ErrMsg) EQ 0>
> <!--- initialze form variables --->
> <cfset Variables.foo = "">
><cfelse>
> <!--- errors found: get data from structure --->
> <cfset Variables.foo = "#stCreatAcct.foo#">
></cfif>
>
>In createacct_rd.cfm (where I'm going to do the validation), I set up a
>structure to hold the form fields. After that I'll have a
>validation.cfc to go through each item before determing whether to
>return back to the form or to insert into the table. If ErrMsg is GT
0,
>then I have a cflocation going back to the main template with error
>messages displaying.
>
>The problem is that I'm getting an "undefined element" message. So,
how
>do I pass the structure back to the main template to repopulate the
form
>field? I'm sure there is a way to do this but not through the
>cflocation URL since structure is a complex object.
--
Lola, who won't part with her Jensen Tina II and Majacraft Gem
spinning wheels!
+ __________________________________________
^ | v i s i t | l j l s p i n o f f s |
+ / \ | |
^(_____) | http://www.lolajl.net |
/ \| o | + | --------------------------------- |
(___| o | ^ | Gospodi pomilui | Lord have mercy |
|o_|___|_ / \ |___mailto:[EMAIL PROTECTED]|_ICQ 14914550___|
| | | (___)
| | | | | Fear no evil - goodness prevails.
| |o o o| | o | *That's why they call it a drop spindle.*
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

