# Validation In Mautic Form

**URL:** <https://forum.mautic.org/t/validation-in-mautic-form/20303>\
**Category:** General Discussion\
**Created:** [July 29, 2021, 4:48am UTC](https://forum.mautic.org/t/validation-in-mautic-form/20303 "2021-07-29T04:48:47Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![aquib](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/aquib/32/5421_2.png) [@aquib](https://forum.mautic.org/u/aquib)\
**Post date:** [July 29, 2021, 4:48am UTC](https://forum.mautic.org/t/validation-in-mautic-form/20303/1 "2021-07-29T04:48:47Z")

</div>

Hello  
Want To Know How Can I Add Validation In Email Address In Mautic Form i.e I Want To Add Validation Like Only Domain Emails Is Allowed Like [info@mohdaquib.com](mailto:info@mohdaquib.com) & No Gmail Id’s Are Allowed.  
How Can I Achieve That ?

---

<div class="post-metadata">

**Author:** ![nsomaru](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nsomaru/32/2801_2.png) [@nsomaru](https://forum.mautic.org/u/nsomaru)\
**Post date:** [July 29, 2021, 11:27am UTC](https://forum.mautic.org/t/validation-in-mautic-form/20303/2 "2021-07-29T11:27:52Z")

</div>

So I’ve been thinking about this problem a lot. I don’t know _much_ about php but I don’t see any way to get custom validation without a plug-in. There’s two answers that are sort of satisfactory, both of them use JavaScript:

1. Inject and implement front end validation on the page you’re hosting the form

2. Use another form plugin where you can control validation that integrates with mautic (there’s a few) but inject an on submit js that correctly submits the email address (if you’re collecting one) before the form is submitted so that the anonymous contact is correctly merged.

(2) is only useful if you’re relying on the form to identify the contact.

Good luck!

---

<div class="post-metadata">

**Author:** ![aquib](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/aquib/32/5421_2.png) [@aquib](https://forum.mautic.org/u/aquib)\
**Post date:** [July 31, 2021, 2:59am UTC](https://forum.mautic.org/t/validation-in-mautic-form/20303/3 "2021-07-31T02:59:40Z")

</div>

Ok Sure I Will Try These Methods.  
Thank You For The Help

---

<div class="post-metadata">

**Author:** ![aquib](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/aquib/32/5421_2.png) [@aquib](https://forum.mautic.org/u/aquib)\
**Post date:** [July 31, 2021, 3:00am UTC](https://forum.mautic.org/t/validation-in-mautic-form/20303/4 "2021-07-31T03:00:24Z")

</div>

Also Can You Please Explain What Is The Use Of This Field In Mautic Forms.

![Capture](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/5/5f437c91f3c5f2afdb93ce917f4e907328881f3e.png)

---

<div class="post-metadata">

**Author:** ![nsomaru](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nsomaru/32/2801_2.png) [@nsomaru](https://forum.mautic.org/u/nsomaru)\
**Post date:** [July 31, 2021, 6:41am UTC](https://forum.mautic.org/t/validation-in-mautic-form/20303/5 "2021-07-31T06:41:59Z")

</div>

The way I understand this field can be shown by an example. Let’s say you’re running a competition where users have to submit the details of 3 friends to win some tickets to an event.

So on some previous page you’ve submitted your own details. Now we land a page where this kind of field has _3_ as it’s value. Remember, we want them to enter friend details one at a time. Here’s the user flow:

1. User submits the form 3 times.

2. At the third submission, an SMS is sent to them (with a link) where they must complete some action and get a code.

3. That code can then be entered in this field to unlock some discount.

So basically it’s there to unlock fields where you’re trying to encourage multiple submissions.

---

<div class="post-metadata">

**Author:** ![yukzanaly](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yukzanaly/32/1769_2.png) [@yukzanaly](https://forum.mautic.org/u/yukzanaly)\
**Post date:** [August 2, 2021, 4:53pm UTC](https://forum.mautic.org/t/validation-in-mautic-form/20303/6 "2021-08-02T16:53:01Z")

</div>

show after x submissions.

if you set 2 (two times), this field will show to the contact the second time that contact fill out the form. this is a really awesome feature.

here’s how I usually do this.

I want to collect three data from a contact, email, first name and phone number.

the first time a contact visits my web, she will fill in one field: the email field. if tomorrow she visits again, she’ll see two fields, name and email.

---

<div class="post-metadata">

**Author:** ![yukzanaly](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yukzanaly/32/1769_2.png) [@yukzanaly](https://forum.mautic.org/u/yukzanaly)\
**Post date:** [August 2, 2021, 4:55pm UTC](https://forum.mautic.org/t/validation-in-mautic-form/20303/7 "2021-08-02T16:55:43Z")

</div>

You can do this in all of your forms.

go to configuration, from settings and set do not accept from these domains.

![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/c/cb321c272f3a42fb8559481c63c1c6b2a95f7adc.png)
