I always pass a hidden form element that is a counter filled in by JS for
how many fields have been added.  So if I have a field named foo_1 and I add
foo_2, foo3, foo_4 and take away even foo_2 my hidden counter will pass in
4.  then on the processing side I do a loop over my counter, something like:

<cfloop from="1" to="#Form.Counter#" index="i">
<cfif StructKeyExists(FORM, "foo_#i#") AND Trim(Form["Foo_#i#"]) IS NOT
"">Then do something</cfif>
</cfloop>

On Fri, Dec 19, 2008 at 2:02 PM, Judah McAuley <[email protected]> wrote:

> The way I do this is to have each form field have an underscore in it.
> So play_1, play_2, etc
>
> Then I'd loop over the FORM collection and do a listfirst with _ as a
> delimiter to figure out if I've got a play, a po, a role, etc or some
> random field (like submit) that I don't care about. Then append the
> value of form.play_1 to my playarray and move on to the next item in
> the form collection.
>
> Judah
>
> On Fri, Dec 19, 2008 at 11:57 AM, Scott Stewart <[email protected]>
> wrote:
> > Hey all,
> >
> > I have a form with one of those wonderful dynamic "ad form row" widgets.
> > Because of this I never will know exactly what fields will be sent for
> > processing...
> >
> > the original four fields in the row are called "play", "po", "role", and
> > "year", the javascript generates "play1", "po1", "role1" and "year1" or
> > 2, or 3 ad Infinitum based on how many rows the user has selected.
> > on the processing side I need to write the form field values to a
> > structure because there will be credit card processing before I write to
> > the database.
> >
> > How can I loop over the form structure and find the dynamically
> > generated form fields and their values.
> >
> > --
> > Scott Stewart
> > ColdFusion Developer
> >
> > Office of Research Information Systems
> > Research &amp; Economic Development
> > University of North Carolina at Chapel Hill
> >
> > Phone:(919)843-2408
> > Fax: (919)962-3600
> > Email: [email protected]
> >
> >
> >
> >
>
> 

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

Reply via email to