# Form submission trigger \> Check validation

**URL:** <https://community.piwik.pro/t/form-submission-trigger-check-validation/4167>\
**Category:** Data collection and tags\
**Created:** [July 4, 2024, 7:15am UTC](https://community.piwik.pro/t/form-submission-trigger-check-validation/4167 "2024-07-04T07:15:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ValPiwik](https://avatars.discourse-cdn.com/v4/letter/v/ecd19e/32.png) [@ValPiwik](https://community.piwik.pro/u/ValPiwik)\
**Post date:** [July 4, 2024, 7:15am UTC](https://community.piwik.pro/t/form-submission-trigger-check-validation/4167/1 "2024-07-04T07:15:44Z")

</div>

Hello,

On my website. I have a form.

- If the user fills properly and send the form, he receives a thank-you message.
- If the user doesn’t fill properly and send the form, he receives an error message.
- In both cases, we do not change the URL. We stay on the same page.

I would like to trigger two tags:

- One when the form is properly filled and sent.
- One when the form is not properly filled and doesn’t send.

I tested the form submission trigger, but in all cases, my tags are triggered, there is no validation check (like in GTM).

How can I put this tracking in place?

Many thanks,

---

<div class="post-metadata">

**Author:** ![kamilb](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/kamilb/32/309_2.png) [@kamilb](https://community.piwik.pro/u/kamilb)\
**Post date:** [July 4, 2024, 4:10pm UTC](https://community.piwik.pro/t/form-submission-trigger-check-validation/4167/2 "2024-07-04T16:10:45Z")

</div>

Hi @ValPiwik,

The form submit trigger fires on all submit events. This means that even when the form has errors it still sends the submit event (in your case). In this case I would recommend to implement dataLayer events with validation so that you send an event to the dataLayer whenever the form is sent or is not filled properly (gives errors). You can then create events which you need and set them on the dataLayer trigger.

Have a great day! 🙂
