Not sure if this is exactly what you are looking for or not . . . 

What you have:
        form.blocks = a list of ids for checkboxes that are checked
        form.sideX1, X2, X3, etc. = multiple radio buttons that could be of
a value of left or right, or not defined (if the user didn't select either
one)

Try this:
<!--- initialize your arrays --->
<cfset arLeft = arraynew(1)>
<cfset arRight = arraynew(1)>
<cfset arUndecided = arraynew(1)>
        <!--- NOTE: you could do this as a single two-dimension array also
--->

<!--- loop through the list of checked checkboxes
<cfloop list="#form.blocks#" index="i">
        <cfif not isdefined("form.side#i#")>
                <cfset arrayappend(arUndecided, i)>
        <cfelseif evaluate("form.side#i#") eq "left">
                <cfset arrayappend(arLeft, i)>
        <cfelse>
                <cfset arrayappend(arRight, i)>
        </cfif>
</cfloop>

If this doesn't work, hopefully it is close . . . 

Dan



-----Original Message-----
From: Grady Milhon [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 04, 2000 9:59 AM
To: CF-Talk
Subject: RE: Brain Buster


Sorry, this is the most difficult thing to explain in an email.

Input - Form.blocks
Output - left_list (Check items whose radio button was selected as left)
Output - right_list (Check items whose radio button was selected as right)

I was thinking loop through the list of checked items, then check the radio
button as whether it is left or right, depending on that, it would add the
item
to the correct list.  The problem is you can't check a variable with a
dynamic
name, such as side_#id# (i.e. side_1=left/right, side_2=left/right).  Does
this
clear it up?  Thanks for the help.

-----Original Message-----
From:     [EMAIL PROTECTED] at INTERNET
Sent:     Wednesday, October 04, 2000 11:02 AM
To:     [EMAIL PROTECTED] at INTERNET
Subject:     RE: Brain Buster

I'm not completely clear on the output you want, but here are some ideas:

1) Make your life simpler.  You can loop through the list:
<cfloop index="ITEM" list="FORM.BLOCKS">
     #item#<br>
</cfloop>

2) Show us your output.

-----Original Message-----
From: Grady Milhon [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 04, 2000 10:46 AM
To: CF-Talk
Subject: Brain Buster


I have a form, with a check box and two radio buttons.  When submitted, I
want
two arrays, one with all checked items with the first radio button selected
and
one with all checked items with the second radio button selected.  I am
having a
very had time doing this.

Here is my code from the form:

<form action="action.cfm" method="post">
<table>
<cfoutput query="blocks">
<tr>
<td>
<input type="checkbox" name="blocks" value="#id#">
</td>
     <td>#name#</td>
     <td>
<input type="radio" name="side_#id#" value="left"> Left
          <input type="radio" name="side_#id#" value="right"> Right
     </td>
</tr>
</cfoutput>
</table>
<p><input type="submit" value="Save">
</form>

This code will display the values of the checkboxes that are checked:

(action.cfm)

<cfset aryBlocks=listtoarray(form.blocks,chr(44))>
<cfloop index="i" from="1" to="#arraylen(aryBlocks)#">
     #aryBlocks[i]#<br>
</cfloop>
</cfoutput>


Can someone PLEASE help me.

Thanks,

Grady Milhon
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to