Sometimes you might need to submit a form without enforcing all the validation rules, perhaps for testing purposes or under specific conditions. In this tutorial, we’ll walk through a simple way to bypass Fluent Form validations for specific forms. By following these steps, you’ll learn how to set it up and customise it to fit your needs.
What We’re Doing
We’ll write some code that:
- Checks if a specific form ID is targeted.
- If the form ID is in the target list, it will remove all validation rules from our form fields.
1. Setting Up the Bypass
First, we need to create a function that hooks into Fluent Form’s rendering process. This function will check if the form ID is in our target list and decide whether to bypass the validations.