Title: [Plugin: Custom Field Template] Duplicate input ids on multiple fieldsets
Last modified: August 19, 2016

---

# [Plugin: Custom Field Template] Duplicate input ids on multiple fieldsets

 *  [wownewmedia](https://wordpress.org/support/users/wownewmedia/)
 * (@wownewmedia)
 * [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-custom-field-template-duplicate-input-ids-on-multiple-fieldsets/)
 * Hello,
 * I’ve come across something which is causing a few problems.
 * I am successfully using multiple field sets except for the type = file field.
 * Basically, when you hit Add New, it duplicates the above field including the 
   id. So, If I add an image the the new field set, it affects the field above –
   deleting.
 * I’ve spotted this line of code in the plugin which seems to clone all above on
   Add New. I guess all we need to be able to do is increment the id also.
 * Anybody got a solution?
 * `$addfield .= ' <a href="#clear" onclick="var tmp = jQuery(this).parent().parent().
   parent().clone().insertAfter(jQuery(this).parent().parent().parent());tmp.find('."'
   input[type=text],input[type=hidden],input[type=file]'".').val('."''".');tmp.find('."'
   select'".').val('."''".');tmp.find('."'textarea'".').val('."''".');tmp.find('."'
   input'".').attr('."'checked',false".');if(tmp.find('."'input[type=radio]'".').
   attr('."'name'".')){if(tmp.find('."'input[type=radio]'".').attr('."'name'".').
   match(/\[([0-9]+)\]$/)) { matchval = RegExp.$1; matchval++;tmp.find('."'input[
   type=radio]'".').attr('."'name',".'tmp.find('."'input[type=radio]'".').attr('."'
   name'".').replace(/\[([0-9]+)\]$/, \'[\'+matchval+\']\'));}}jQuery(this).parent().
   css('."'visibility','hidden'".');return false;">' . __('Add New', 'custom-field-
   template') . '</a>';`
 * [http://wordpress.org/extend/plugins/custom-field-template/](http://wordpress.org/extend/plugins/custom-field-template/)

The topic ‘[Plugin: Custom Field Template] Duplicate input ids on multiple fieldsets’
is closed to new replies.

 * ![](https://ps.w.org/custom-field-template/assets/icon-256x256.png?rev=1966286)
 * [Custom Field Template](https://wordpress.org/plugins/custom-field-template/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-field-template/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-field-template/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-field-template/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-field-template/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-field-template/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [wownewmedia](https://wordpress.org/support/users/wownewmedia/)
 * Last activity: [15 years, 6 months ago](https://wordpress.org/support/topic/plugin-custom-field-template-duplicate-input-ids-on-multiple-fieldsets/)
 * Status: not resolved