# Form Input Custom Validation

**URL:** <https://community.weweb.io/t/form-input-custom-validation/17998>\
**Category:** Ask us anything\
**Created:** [April 28, 2025, 5:13pm UTC](https://community.weweb.io/t/form-input-custom-validation/17998 "2025-04-28T17:13:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![przemek](https://avatars.discourse-cdn.com/v4/letter/p/96bed5/32.png) [@przemek](https://community.weweb.io/u/przemek)\
**Post date:** [April 28, 2025, 5:13pm UTC](https://community.weweb.io/t/form-input-custom-validation/17998/1 "2025-04-28T17:13:52Z")

</div>

I have a form with an email input. I want to create custom validation such that it checks that email value is a gmail email.

I add the logic check using a formula. When I test using a none gmail address the formula correctly evaluations to false but the isValid on the field and the entire form is set to null; furthermore, I don’t see a way to set a custom error message when my custom validation fails.

What I’m expecting to see is that if my custom validation function fails I see my custom error message.

Perhaps I’m misinterpreting how custom validation is designed to work?

 ![Screenshot 2025-04-28 at 10.12.51](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/3/307cbe0efdacdb8a91f941d54a78b04c79ac6d9f.jpeg)

---

<div class="post-metadata">

**Author:** ![DanielL](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/daniell/32/13398_2.png) [@DanielL](https://community.weweb.io/u/DanielL)\
**Post date:** [April 29, 2025, 9:09am UTC](https://community.weweb.io/t/form-input-custom-validation/17998/2 "2025-04-29T09:09:03Z")

</div>

Hi @przemek

Is your validation on form submit or on change? Can you check all the steps from: [Form container | Documentation](https://docs.weweb.io/elements/form-container.html)
