On 8/4/06, Mingo Hagen <[EMAIL PROTECTED]> wrote:
> I would do that a little different. You coul repeat the checkboxes like so:
>
> <input typ="checkbox" name="isBannedUserID" value="1" />
> <input typ="checkbox" name="isBannedUserID" value="2" />
> <input typ="checkbox" name="isBannedUserID" value="3" />
>
> On the other side of the form action you would receive a list of id's in
> the form.isBannedUserID, like this: "1,2,3" for all checked inputs.
> Which you could then directly use in an UPDATE sql statement. (WHERE
> userID IN ( <cfqueryparam cfsqltype="cf_sql_integer"
> value="#form.isBannedUserID#" list="yes"> ))

Thank you, i'll try that


>
> Mingo.
>
>
> Dmitrii Dimandt wrote:
> > I know that :)
> >
> > What I needed is a simple way to output and process a number of very
> > similar fields. Let's say, you want to ban 10 users from a forum at
> > once. After you've found these users, you could output this:
> >
> >     <input type="checkbox" name="User[10][IsBanned]" value="banned" />
> >     <input type="checkbox" name="User[20][IsBanned]" value="banned" />
> >     <input type="checkbox" name="User[30][IsBanned]" value="banned" />
> >     etc.
> >
> > After the form is submitted you could do this in PHP:
> >
> >    while(list($key, $value) = each($_POST['User']))
> >    {
> >        /* $key now holds 10, 20, 30 ..., $val holds the value of the 
> > checkbox */
> >    }
> >
> > Additionally each field is accessible through 
> > $_POST['User']['10']['isBanned'].
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:248795
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