title: pass multiple checkboxes' values to the textbox
body: <p>I need Java script to  pass multiple checkboxes' values to the textbox?</p>
  
  <p>For example:
  If I check two checkboxes then I see the textbox shows two checkboxes' values separated by a comma like "coffee,beer".when I uncheck the checked  checkboxes,  that particular value alone should dissappear from the textbox.</p>
  
  <pre><code>       &lt;form name="form1"&gt;
         &lt;input type="checkbox" name="checkboxname" value="coffee"&gt;
         &lt;input type="checkbox" name="checkboxname" value="tea"&gt;
         &lt;input type="checkbox" name="checkboxname" value="beer"&gt;
  
           &lt;/form&gt;
  
            &lt;form name="form2"&gt;
            &lt;input type="text" name="textname"&gt;
                &lt;/form&gt;
  </code></pre>
  
  <p>Thank you for your help.</p>