Archive for the ‘jQuery’ Category

Duplicating sets of radio buttons with jQuery

Monday, July 6th, 2009

We all love the “add more” links for adding more form items to forms. More pictures to upload, more categories to add. You just name them with empty square brackets and then clone them.

  1.  
  2. <input type="file" name="file[]" value=""/>
  3. <a href="" id="addMoreUploads">add more</a>
  4.  

But what if you need to clone sets of radio buttons? You end up with a single group of radio buttons – not with a group of radio button groups.
(more…)