I get this cryptic error when running that:

Element 1 is undefined in a CFML structure referenced as part of an
expression.
even though my stuff is getting passed:

        <label for="linkname_1">Link Name 1</label>             
                        <input name="linkname_1" id="linkname1" value="Event 
Registration"
size="35" maxlength="255" type="text" class="textInput" />

                        <label for="linkurl_1">URL 1</label>            
                        <input name="linkurl_1" id="url1" value="/registration" 
size="35"
maxlength="255" type="text" class="textInput" />




2008/10/29 Jake Churchill <[EMAIL PROTECTED]>

> 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:314530
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to