title: Creating string of checkbox ids if checked
body: <p>I have a form with a series of radio buttons and checkboxes used to tally up a cost before sending the user to a payment gateway.</p>
  
  <p>The inputs are nothing unusual, except I've used the 'value' property for the associated price as when any input is changed, a table is edited to show chosen options, their associated prices and then the total.</p>
  
  <pre><code>&lt;input type="checkbox" id="cb1" value="100" name="cb1"&gt;
  &lt;input type="checkbox" id="cb2" value="200" name="cb2"&gt;
  &lt;input type="radio" id="rd1" value="500" name="rdo"&gt;
  &lt;input type="radio" id="rd2" value="500" name="rdo"&gt;
  </code></pre>
  
  <p>I was slightly stupid and didn't think ahead as to how I was then going to actually process the completed form when submitted in terms of determining what the user has selected. </p>
  
  <p>Sending the final total through is fine as that's stored in a readonly input. However, I also need to save to the database which checkboxes have been selected and which radio is selected.</p>
  
  <p>The checkboxes are manageable as they only have a value in $_POST if they are ticked so I can cycle through them all and only keep the ones whose value isn't empty. </p>
  
  <p>Any thoughts for how to handle the radio buttons? Re-writing the form is a last resort at this stage if possible to not do so.</p>