title: pass checkbox values from child form to parent form upon submit using javascript
body: <p>I have the below code in a coldfusion parent form. ON click of a checkbox a child window (abc.cfm) opens which has for example 5 checkboxes related to the check box on the parent window. </p>
  
  <pre><code>&lt;input type="checkbox" name="inq" id="inq" value="#item_code#"     onClick="window.open('abc.cfm?inq=#item_code#');"&gt;#item_description#  
   &lt;span class="style6"&gt;Click the checkbox for the list&lt;/span&gt;
  </code></pre>
  
  <p>User checks 1 or more check boxes on the child window and hits submit on the abc.cfm page; the child page will close and The values selected need to be displayed on the parent.cfm page. Can anyone please let me know how to go about this.</p>
  
  <p>This is on my parent cfm page.</p>
  
  <pre><code>  &lt;td colspan="2"  class="trr3"&gt;&lt;textarea cols="30" rows="5"  name="narr"&gt;&lt;/textarea&gt;    &lt;/td&gt;
    &lt;td width="32" valign="top"  class="trr3"&gt;Brief&lt;/td&gt;
    &lt;td width="499" valign="top"  class="trr3"&gt;&lt;input type="text" name="brief" size="30"&gt;&lt;/td&gt; 
  </code></pre>
  
  <p>I have the below code on the child abc.cfm page.</p>
  
  <pre><code>&lt;SCRIPT LANGUAGE="JavaScript"&gt;
  
   function figure_this_out(){
     var boxes = document.form1.cat;
      var display = "";
       var t = document.getElementById("category_id").value;
      for (i = 0; i &lt; boxes.length; i++){
      if (boxes[i].checked == true){
     display = display + boxes[i].value + ", ";
     t = display;
    //alert(t);
    window.opener.document.getElementById("category_id").value=t;
    window.opener.document.getElementById("narr").value =          document.getElementById("narr").value;
   window.opener.document.getElementById("brief").value =                    document.getElementById("brief").value;
         }
           }
          window.close();
              } 
               &lt;/script&gt;
  
         &lt;table&gt;
        &lt;cfloop query="nature_compl"&gt; 
           &lt;cfif nature_compl.currentrow mod 3 EQ 1&gt;      
          &lt;tr&gt;
       &lt;/cfif&gt;
      &lt;td class="trr3"&gt;
  
      &lt;input type="checkbox" id="cat" name="cat" value="#category_id#"   onClick="if (this.checked) this.form.category_id.value=this.value; else    this.form.category_id.value=''" &gt;
       #category_description#
  
       &lt;/td&gt;
          &lt;/cfloop&gt;
  
           &lt;input  type="hidden" name="category_id" id="category_id"   value=""&gt;
          &lt;tr&gt;
       &lt;/td&gt; 
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td class="trr3"&gt;
  Brief &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  &lt;input type="text" name="brief" size="38"&gt;
  &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td class="trr3"&gt;
  Narrative
  &lt;textarea cols="30" rows="5"  name="narr"&gt;&lt;/textarea&gt;
  &lt;/td&gt;
  
  &lt;/tr&gt;
   &lt;tr&gt;
   &lt;td&gt;&lt;input type="button" class="groovybutton2" value="SUBMIT" name="save"   onClick="figure_this_out();" &gt; 
  
       &lt;/td&gt;
  
    &lt;td colspan="3"&gt;&amp;nbsp;&lt;/td&gt;
    &lt;/tr&gt;
   &lt;/table&gt;
  </code></pre>