macromedia.coldfusion.advanced_techniques
[Top] [All Lists]

Re: Advanced Form Query

Subject: Re: Advanced Form Query
From: GArlington <garlington@xxxxxxxxxxxxx>
Date: Wed, 30 Jul 2008 02:35:18 -0700 (PDT)
Newsgroups: macromedia.coldfusion.advanced_techniques

On Jul 29, 6:09 pm, "theBeachBum" <webforumsu...@xxxxxxxxxxxxxx>
wrote:
> Hi All,
>
>  Need help w/ a form technique.
>
>  If I have X number of check boxes that are created dynamically, from 1 to X.
>
>  On submit, I want to check if the box is checked, and if it is checked 
> perform
> an action.  I wrote the below but it's not working, need some help.
>
>          <cfloop index="i" from="1" to="#query.recordcount#">
>
>         <cfif #FORM.i# NEQ "">
>              <cfquery datasource="#application.dsn#" name="action">
>               XXX
>              </cfquery>
>            </cfif>
>
>          </cfloop>

1. Lookup valid form field names [hint: should start with the LETTER,
NOT NUMBER]
2. Use struct/array notation when accessing dynamic names
struct[fieldName] (in your case form["cb#i#"])

<Prev in Thread] Current Thread [Next in Thread>