# Custom form field duplicates temporarily on edit

**URL:** <https://forum.mautic.org/t/custom-form-field-duplicates-temporarily-on-edit/34102>\
**Category:** Development\
**Created:** [November 12, 2024, 12:33pm UTC](https://forum.mautic.org/t/custom-form-field-duplicates-temporarily-on-edit/34102 "2024-11-12T12:33:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dband](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dband/32/12768_2.png) [@dband](https://forum.mautic.org/u/dband)\
**Post date:** [November 12, 2024, 12:33pm UTC](https://forum.mautic.org/t/custom-form-field-duplicates-temporarily-on-edit/34102/1 "2024-11-12T12:33:12Z")

</div>

I developed a form field to display a custom captcha solution. It works fine, except when I try do edit the field. Every time I click on edit a new widget is appended to the form editor. Also, I cant delete the field, while I haven’t saved the form with the new field for the first time (because $request-\>isXmlHttpRequest() is false, why?). I looked at the FieldController where the field is rendered and passed back to the Ajax request. After saving the form the duplicates are gone and the form works fine. But I cant figure why my custom field behaves that way. Any ideas?

In case you would like to have a look at the repository, it’s [here](https://github.com/TAWK-GmbH/mautic-friendlycaptcha).

 ![Screenshot 2024-11-12 at 19.23.08](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/0/0df9485cba46feec6cb709e519576ab09a05e876.png)  
 ![Screenshot 2024-11-12 at 19.29.06](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/c/c453547fc3f82561e8a30eda53f441339670353a.png)

---

<div class="post-metadata">

**Author:** ![dband](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dband/32/12768_2.png) [@dband](https://forum.mautic.org/u/dband)\
**Post date:** [January 6, 2026, 2:18am UTC](https://forum.mautic.org/t/custom-form-field-duplicates-temporarily-on-edit/34102/2 "2026-01-06T02:18:26Z")

</div>

UPDATE: My form field id was wrong and thus I got this wired duplication error

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/1X/43c63600fe51440378769136903f1fa2a9a34102.png) [@system](https://forum.mautic.org/u/system)\
**Post date:** [January 7, 2026, 2:18pm UTC](https://forum.mautic.org/t/custom-form-field-duplicates-temporarily-on-edit/34102/3 "2026-01-07T14:18:29Z")

</div>

This topic was automatically closed 36 hours after the last reply. New replies are no longer allowed.
