You are close. Try this:
<cfset counter = 1>
<cfset resultStruct = StructNew()>
<cfloop list="#structKeyList(form)#" index="key">
<cfoutput>
<cfif len(form[key]) GTE 1 AND key CONTAINS "link">
<cfset resultStruct[counter].linkUrl = form["linkUrl_"&counter]>
<cfset resultStruct[counter].linkText = form["linkText_"&counter]>
<cfset counter = counter + 1>
</cfif>
</cfoutput>
</cfloop>
-Jake Churchill
Tom King wrote:
> Hi All,
>
> I've got a form where I've got a potentially unknown number of form fields
> as they're being added by Javascript;
>
> i.e
> form.linkText_1
> form.linkUrl_1
> form.linkText_2
> form.linkUrl_2
> form.linkText_3
> form.linkUrl_3
> form.linkText_4
> form.linkUrl_4
>
> How can I deal with this at the other end?
>
> I can output them (but in no useful order):
>
> <cfloop list="#structKeyList(form)#" index="key">
> <cfoutput>
> <cfif len(form[key]) GTE 1 AND key CONTAINS "link">
> <p>Key: #key#, Value: #form[key]#</p>
> </cfif>
> </cfoutput>
> </cfloop>
>
> How would I get these into an Array or a Query object where they are paired
> up by number?
>
> Thanks
> T
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive:
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:314529
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4