RE: fieldnames structure

2001-08-31 Thread Raymond Camden

Form.Fieldnames is a list of all the form fields. You want just Form.
Also, you can't place a structure in a form field like that, it's not a
simple string. You can, however, convert the form structure to a wddx packet
and put _that_ in a form field.

CFSET Form.Foo = 1
CFWDDX ACTION=CFML2WDDX INPUT=#Form# OUTPUT=Formpacket

FORM
CFOUTPUT
INPUT TYPE=hidden NAME=OldData VALUE=#FormPacket#
/CFOUTPUT
/FORM

You may want to URL encode FormPacket to ensure no line breaks are in.

===
Raymond Camden, Principal Spectra Compliance Engineer for Macromedia

Email: [EMAIL PROTECTED]
Yahoo IM : morpheus

My ally is the Force, and a powerful ally it is. - Yoda

 -Original Message-
 From: Deanna Schneider [mailto:[EMAIL PROTECTED]]
 Sent: Friday, August 31, 2001 11:38 AM
 To: CF-Talk
 Subject: fieldnames structure


 Hi Folks,
 I'm trying to figure out this structure thing, and I have a
 project where I
 have to grab all the fieldname/value pairs from one form, hold them while
 the user fills out a second page, then send them along in a
 hidden field to
 the action page.

 What's the best way to do this? I thought I could just do something like:
 input type=hidden name=page1struct
 value=#structcopy(form.fieldnames)# But that throws an error.

 -d



 Deanna Schneider
 Interactive Media Developer
 [EMAIL PROTECTED]





~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



Re: fieldnames structure

2001-08-31 Thread Critter

Hello Deanna,

whynot just

cfset 1stPage = structcopy(form)

then access that structure on the second page?



-- 
Critter, MMCP
Certified ColdFusion Developer

Crit[s2k] - CF_ChannelOP Network=Efnet Channel=ColdFusion
---
Friday, August 31, 2001, 11:38:20 AM, you wrote:

DS Hi Folks,
DS I'm trying to figure out this structure thing, and I have a project where I
DS have to grab all the fieldname/value pairs from one form, hold them while
DS the user fills out a second page, then send them along in a hidden field to
DS the action page.

DS What's the best way to do this? I thought I could just do something like:
DS input type=hidden name=page1struct
DS value=#structcopy(form.fieldnames)# But that throws an error.

DS -d



DS Deanna Schneider
DS Interactive Media Developer
DS [EMAIL PROTECTED]




DS
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: fieldnames structure

2001-08-31 Thread Alex Santantonio

Loop through the list of field names, 
CFOUTPUT
CFLOOP LIST=#FORM.Fieldnames# INDEX=field
INPUT TYPE=Hidden NAME=#field# VALUE=#Evaluate(FORM. 
Field)#
/CFLOOP 
/CFOUTPUT
-Original Message-
From: Deanna Schneider [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 31, 2001 11:38 AM
To: CF-Talk
Subject: fieldnames structure

Hi Folks,
I'm trying to figure out this structure thing, and I have a project where I
have to grab all the fieldname/value pairs from one form, hold them while
the user fills out a second page, then send them along in a hidden field to
the action page.

What's the best way to do this? I thought I could just do something like:
input type=hidden name=page1struct
value=#structcopy(form.fieldnames)# But that throws an error.

-d



Deanna Schneider
Interactive Media Developer
[EMAIL PROTECTED]
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: fieldnames structure

2001-08-31 Thread Dave Watts

 I'm trying to figure out this structure thing, and I have a 
 project where I have to grab all the fieldname/value pairs 
 from one form, hold them while the user fills out a second page, 
 then send them along in a hidden field to the action page.
 
 What's the best way to do this? I thought I could just do 
 something like: input type=hidden name=page1struct
 value=#structcopy(form.fieldnames)# But that throws an error.

That's not going to work, because a structure can't be simply written to a
string, as you're trying to do. If you want to pass data from one page, to
the next, it'll have to be string data of some type. You could use WDDX to
convert complex objects (arrays, structures, queries) to strings, then write
the WDDX strings to your form fields, then convert them back to complex
objects using CFWDDX in the action page. Or, you could use the Session scope
to store the data persistently.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444

~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: fieldnames structure

2001-08-31 Thread Tyson Vanek

Deana,

You're close.  The FORM scope itself is actually just one big structure,
which means you can copy it and pass it along.  You'll likely, however, need
to convert it to something that can be passed in the form hidden field - I'd
recommend WDDX.  Try something like this.

!--- copy the form scope from the previous page submission ---
cfset stcPage1 = structCopy(form)
!--- encode it as a WDDX packet ---
cfwddx action=cfml2wddx input=#stcPage1# output=wstcPage1
!--- embed it in the form on page 2 ---
cfoutput
input type=hidden name=stcPage1 value=#wstcPage2#
/cfoutput

This will pass the struct as a WDDX packet named wstPage1.  In order to
access the values of the struct on the next page, you'll need to
de-serialize it first, like this (this would be in the submit logic on page
2):

cfwddx action=wddx2cfml input=#form.wstcPage1# output=stcPage1

Then you should be able to reference fields from page one in the following
manner:

cfoutput
#stcPage1.strFormField1#br
#stcPage1.strFormField2#br
/cfoutput

Hope this helps,
Tyson


-Original Message-
From: Deanna Schneider [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 31, 2001 10:38 AM
To: CF-Talk
Subject: fieldnames structure


Hi Folks,
I'm trying to figure out this structure thing, and I have a project where I
have to grab all the fieldname/value pairs from one form, hold them while
the user fills out a second page, then send them along in a hidden field to
the action page.

What's the best way to do this? I thought I could just do something like:
input type=hidden name=page1struct
value=#structcopy(form.fieldnames)# But that throws an error.

-d



Deanna Schneider
Interactive Media Developer
[EMAIL PROTECTED]
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: fieldnames structure

2001-08-31 Thread Andrew Scott

First off all, if you could do this then why not just reference the form
field directly. Secondly I think it was asked when a new page is
displayed, after the first was submitted so this will not work!

Regards,
Andrew Scott



-Original Message-
From: Critter [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, 1 September 2001 1:56 AM
To: CF-Talk
Subject: Re: fieldnames structure

Hello Deanna,

whynot just

cfset 1stPage = structcopy(form)

then access that structure on the second page?



-- 
Critter, MMCP
Certified ColdFusion Developer

Crit[s2k] - CF_ChannelOP Network=Efnet Channel=ColdFusion
---
Friday, August 31, 2001, 11:38:20 AM, you wrote:

DS Hi Folks,
DS I'm trying to figure out this structure thing, and I have a project
where I
DS have to grab all the fieldname/value pairs from one form, hold them
while
DS the user fills out a second page, then send them along in a hidden
field to
DS the action page.

DS What's the best way to do this? I thought I could just do something
like:
DS input type=hidden name=page1struct
DS value=#structcopy(form.fieldnames)# But that throws an error.

DS -d



DS Deanna Schneider
DS Interactive Media Developer
DS [EMAIL PROTECTED]




DS
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists



RE: fieldnames structure

2001-08-31 Thread Alex Santantonio

as an addendum to the idea that I sent along, you will need to do some
additional work if you are including any checkboxes in your initial form.
Use CFPARAM NAME=FORM.checkboxname DEFAULT=defaultvalue at the top of
the resulting page to set the checkbox value if the user didn't check it,
and then you will need to do a LISTAPPEND(FORM.fieldnames,checkboxname) to
include that form name in the field names since CF will not see the checkbox
if it isn't selected, and will not automatically insert the name into the
fieldnames list when you use the CFPARAM.  Just FYI.

-Original Message-
From: Alex Santantonio [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 31, 2001 11:57 AM
To: CF-Talk
Subject: RE: fieldnames structure

Loop through the list of field names,
CFOUTPUT
CFLOOP LIST=#FORM.Fieldnames# INDEX=field
INPUT TYPE=Hidden NAME=#field# VALUE=#Evaluate(FORM. 
Field)#
/CFLOOP
/CFOUTPUT
-Original Message-
From: Deanna Schneider [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 31, 2001 11:38 AM
To: CF-Talk
Subject: fieldnames structure

Hi Folks,
I'm trying to figure out this structure thing, and I have a project where I
have to grab all the fieldname/value pairs from one form, hold them while
the user fills out a second page, then send them along in a hidden field to
the action page.

What's the best way to do this? I thought I could just do something like:
input type=hidden name=page1struct
value=#structcopy(form.fieldnames)# But that throws an error.

-d



Deanna Schneider
Interactive Media Developer
[EMAIL PROTECTED]
~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists