> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.opnform.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How to add custom validation to a field?

Custom validation helps you make sure form submissions meet your specific rules — ensuring cleaner, more reliable data.

For example, you can use it to:
* Make sure an email ends with `@company.com` for internal submissions.
* Require a response to include a certain keyword or phrase.
* Limit how short or long an answer can be.

This is especially useful for company forms, access requests, or workflows that require strict input rules.

To add custom validation to a field in your form, follow these steps:

1. Log in to your account and access the forms section.
2. Locate the specific form you want to edit and click on it.
3. Find the field that requires custom validation and click on the settings icon.
4. Click on the validation tab from the right side of the screen.
5. Choose the desired validation criteria from options like equals, does not equal, contains, does not contain, starts with, ends with, is empty, is not empty, content length equals, content length does not equal, content length greater than, content length greater than or equal to, content length less than, and content length less than or equal to.
6. Configure the conditions based on the criteria you selected.  
   💡 Example: To restrict email addresses to your company domain, select **Ends with** and type `@company.com`.
7. Optionally, provide an error message that will appear if the condition is not met.
8. Publish the form and thoroughly test the custom validation.
9. Remember to save the form after making any changes.

![](https://storage.crisp.chat/users/helpdesk/website/1b5b982fc3df6500/rpqjvmijpo_16xqhmj.png)



| Make sure to save the form before testing the custom validation feature.


${youtube}[](fNPD7ZOzm2s)

