# How to Prevent updating a contact via form?

**URL:** <https://forum.mautic.org/t/how-to-prevent-updating-a-contact-via-form/25486>\
**Category:** Product Support\
**Tags:** mautic-4\
**Created:** [September 22, 2022, 12:07pm UTC](https://forum.mautic.org/t/how-to-prevent-updating-a-contact-via-form/25486 "2022-09-22T12:07:53Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![lukas-sander](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/lukas-sander/32/6510_2.png) [@lukas-sander](https://forum.mautic.org/u/lukas-sander)\
**Post date:** [September 22, 2022, 12:07pm UTC](https://forum.mautic.org/t/how-to-prevent-updating-a-contact-via-form/25486/1 "2022-09-22T12:07:54Z")

</div>

**Your software**  
My Mautic version is: 4.4.2  
My PHP version is: 7.4.30  
My Database type and version is: mysql 8.0.30

**Your problem**  
My problem is:  
I tried creating a form that saves the submitted data into a contact. This works fine. My form consists of first name, last name and email.  
The problem is that I need a way to prevent a contact from being updated when submitted, as to not allow anyone to randomly change contact data from an existing contact.

How can I check and give an error along the lines of “this email is already registered”?

---

<div class="post-metadata">

**Author:** ![robm](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/robm/32/260_2.png) [@robm](https://forum.mautic.org/u/robm)\
**Post date:** [September 22, 2022, 12:36pm UTC](https://forum.mautic.org/t/how-to-prevent-updating-a-contact-via-form/25486/2 "2022-09-22T12:36:26Z")

</div>

I have the same need.

I have the issue where someone completes a form to reg for the event, they then reg a 2nd person for the same event, diff details but they use the same email address so it overwrites person 1.

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [September 22, 2022, 1:59pm UTC](https://forum.mautic.org/t/how-to-prevent-updating-a-contact-via-form/25486/3 "2022-09-22T13:59:59Z")

</div>

@robm : Would you want to have 2 contacts with the same email?

@lukas-sander : The “this email is already registered” can be only done with an ajax call tapping into Mautic’s db and checking all emails.

Joey

---

<div class="post-metadata">

**Author:** ![lukas-sander](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/lukas-sander/32/6510_2.png) [@lukas-sander](https://forum.mautic.org/u/lukas-sander)\
**Post date:** [September 22, 2022, 2:20pm UTC](https://forum.mautic.org/t/how-to-prevent-updating-a-contact-via-form/25486/4 "2022-09-22T14:20:11Z")

</div>

Thank you for the quick response.

Am I right in assuming that the best way to go about this would be using the API?

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [September 22, 2022, 2:23pm UTC](https://forum.mautic.org/t/how-to-prevent-updating-a-contact-via-form/25486/5 "2022-09-22T14:23:45Z")

</div>

Yes. You would make a jquery search via api. In other words: you need to rebuild the form yourself.

---

<div class="post-metadata">

**Author:** ![lukas-sander](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/lukas-sander/32/6510_2.png) [@lukas-sander](https://forum.mautic.org/u/lukas-sander)\
**Post date:** [September 22, 2022, 2:24pm UTC](https://forum.mautic.org/t/how-to-prevent-updating-a-contact-via-form/25486/6 "2022-09-22T14:24:59Z")

</div>

Thank you! I was hoping this would be possible within the mautic backend, but now I know what I need to do.

---

<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:** [September 24, 2022, 2:25am UTC](https://forum.mautic.org/t/how-to-prevent-updating-a-contact-via-form/25486/7 "2022-09-24T02:25:14Z")

</div>

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