Good morning,
I have a checkbox in a Flash Form and I am trying to get the value of it
when I submit it. All that is getting sent to the server is true and false.
The code looks like this:

<cfinput type="checkbox" name="EmailGroup_#GroupID#" value="#GroupID#"
label="#GroupName#">

This is inside of a cfoutput query. What I want is to get the group ID and
use that as the input value instead of true/false. Here is my code to
insert:

<cfparam name="FieldCount" default="0">
<cfloop list="#Form.FieldNames#" index="x">
    <cfif (FindNoCase("EmailGroup_", x) GT 0) AND len(trim(form[x])) GT 0
AND (TRIM(form[x])) NEQ False>
        <cfset FieldCount = Right(x, 1)>
        </cfif>
</cfloop>
    <cfif FieldCount GT 0>
        DELETE FROM tblCouncilEmailGroup
        WHERE MemberID = #Form.councilmemberID#
    </cfif>
            <cfloop from="1" to="#FieldCount#" index="i">
                <cfset groupfield = "EmailGroup_" & i>
                    <cfquery datasource="#Request.dsource#">
                        INSERT INTO tblCouncilEmailGroup
                        (MemberID, GroupID)
                        VALUES (#Form.councilmemberID#
                            <cfif len(StructFind(form, groupfield))>
                                ,#StructFind(form, groupfield)#)
                            </cfif>
                    </cfquery>
            </cfloop>


Thanks,


-- 
Bruce Sorge

"I'm a mawg: half man, half dog. I'm my own best friend!"


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create robust enterprise, web RIAs.
Upgrade & integrate Adobe Coldfusion MX7 with Flex 2
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJP

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