oi Kola!!

I didn't think forms were a structure in versions LT 4.5 ?

I did this to convert them.....

<cfscript>
        //<cf_frmtoStruct struct="myStruct">
        frmStruct = StructNew();
        aryfrmNames = ListToArray(form.fieldnames);
        for(i=1; i LT ListLen(form.fieldnames)+1; i=i+1){
                
StructInsert(frmStruct,"#ListGetAt(form.fieldnames,i)#",evaluate("form." & 
ListGetAt(form.fieldnames,i)));
        }
        SetVariable("caller.#attributes.struct#",frmStruct);
</cfscript>


-- 
Critter, MMCP
Certified ColdFusion Developer

Crit[s2k] - <CF_ChannelOP Network="Efnet" Channel="ColdFusion">


-------------------------------------
Tuesday, November 13, 2001, 9:16:49 AM, you wrote:

KO> Hi

KO> I've been doing some testing with the form scope and have been getting some
KO> inconsistent
KO> results on cf 4.5.1.

KO> AFAIK the form scope is available as a structure:

KO> If i have a form with the following field:

KO> <form name="myform" action="test3.cfm" method="post" >
KO>                 <input type="text" name="name" value="kola" >
KO>                 <input type="Submit" >
KO> </form>

KO> and on the action page create an additional form field,
KO> Then loop over the field names with the follwing code, only the real form
KO> field submmited by the form is displayed.

KO> <cfset form.fake = "hello" >
KO> <cfloop list="#fieldnames#" index="current">
KO> <br><cfoutput>#current#</cfoutput>
KO> </cfloop>
KO> <hr>

KO> If I then loop over the form as a structure:

KO> <cfloop collection="#form#" item="current">
KO> <br><cfoutput>#current#</cfoutput>
KO> </cfloop>

KO> The real form field(form.name), plus the one created on the action page
KO> (form.fake)
KO> and the fieldname variable (form.fieldname) are all
KO> displayed.

KO> So the question is, is this a feature or a bug?

KO> Thanks

KO> Kola





KO> Kola Oyedeji
KO> Web developer
KO> Macromedia Certified Advanced ColdFusion 5 Developer
KO> http://www.Alexandermark.com
KO> (+44)020-8429-7300

KO> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to