title: How to submit values for checked and unchecked dynamically named radio button groups with ColdFusion?
body: <p>I have created a form for a user to upload various images into a gallery.  They can choose the image, which existing category (or create a new category) it should go into and whether or not to display the image as the "featured" image for that category.  </p>
  
  <p>Here is the form:</p>
  
  <pre><code>&lt;FORM action='update_gallery.cfm' method='post' NAME="addform"&gt;
  &lt;TABLE align='center' cellpadding='10' cellspacing='5'&gt;
  &lt;TR&gt;&lt;TH&gt;Delete&lt;/TH&gt;&lt;TH&gt;Image File&lt;/TH&gt;&lt;TH&gt;Preview&lt;/TH&gt;&lt;TH&gt;Category&lt;/TH&gt;&lt;TH&gt;New Category&lt;/TH&gt;&lt;TH&gt;Description&lt;/TH&gt;&lt;TH&gt;Featured?&lt;/TH&gt;&lt;/TR&gt;
  &lt;CFOUTPUT QUERY="getGallery"&gt;
  &lt;TR&gt;
  &lt;TD&gt;&lt;INPUT NAME="ID" TYPE="checkbox" VALUE="#ID#" /&gt;&lt;/TD&gt;
  &lt;TD&gt;#IMAGE#&lt;/TD&gt;
  &lt;TD&gt;&lt;IMG SRC="../images/#IMAGE#" WIDTH='50' HEIGHT='50' /&gt;&lt;INPUT TYPE="hidden" NAME="IMAGE" VALUE="#IMAGE#" /&gt;&lt;/TD&gt;
  &lt;TD&gt;
      &lt;SELECT NAME='CATEGORY'&gt;
      &lt;CFLOOP query="getCategory"&gt;
          &lt;OPTION &lt;cfif #getGallery.CATEGORY# IS '#getCategory.CATEGORY#'&gt;SELECTED&lt;/cfif&gt;&gt;#getCategory.CATEGORY#&lt;/OPTION&gt;
      &lt;/CFLOOP&gt;
  &lt;/SELECT&gt;
  &lt;/TD&gt;
  &lt;TD&gt;&lt;INPUT TYPE="text" SIZE='30' NAME='NewCATEGORY' VALUE="" /&gt;&lt;/TD&gt;
  &lt;TD&gt;&lt;INPUT TYPE="text" SIZE='35' NAME="IMAGE_DESC" VALUE="#IMAGE_DESC#" /&gt;&lt;/TD&gt;
  &lt;TD align="center"&gt;
  &lt;INPUT TYPE="radio" NAME="#CATEGORY#_PIC" ID="CATEGORY_PIC" VALUE="Yes" &lt;cfif #CATEGORY_PIC# IS 'Yes'&gt;CHECKED&lt;/cfif&gt; /&gt;
  &lt;INPUT TYPE="hidden" NAME="CATEGORY_PIC" VALUE="#CATEGORY_PIC#"&gt;
  &lt;/TD&gt;
  &lt;/TR&gt;
  &lt;INPUT TYPE="hidden" NAME="HiddenID" VALUE='#ID#' /&gt;
  &lt;/CFOUTPUT&gt;
  &lt;TR&gt;&lt;TD COLSPAN='6' ALIGN='CENTER'&gt;
  &lt;INPUT TYPE="hidden" NAME="Submitted" VALUE='Y' /&gt;&lt;INPUT TYPE="submit" VALUE='Process Updates' /&gt;&lt;/TD&gt;&lt;/TR&gt;
  &lt;/TABLE&gt;
  &lt;/FORM&gt;
  </code></pre>
  
  <p>Here is the complicated part that I just can't figure out how to do -- for each unique category, there can only be ONE featured image selected, so I created a dynamically-named radio group for each category where only one item can be selected for each category.  When the form is submitted, the "unchecked" radio buttons do not exist as far as ColdFusion goes.  I need to submit a "No" value into the database for the unchecked buttons and a "Yes" value for the checked buttons.  This value should be the CATEGORY_PIC value, for which I've created a hidden form field.</p>
  
  <p>I have been working on this for 4 days straight and searched every possible similar scenario I could find, but there is nothing identical to what I'm trying to accomplish.  It can't be that difficult, but I'm just not finding out how to do this.  </p>
  
  <p>I am running ColdFusion 9 with MS Access database.</p>