Validation
Automatic input validation that catches errors before submission.
How Validation Works
Validation ensures that the data users enter into your form meets your requirements before it is submitted. When a user tries to submit a form, Bosca checks every field against the rules you defined in the form builder. If any field has an issue — a required field left blank, an invalid email address, a number outside the allowed range — the form displays a clear error message next to the problem field and prevents submission until the issue is corrected.
Validation runs in the user's browser, so feedback is instant. Users do not need to wait for a server response to see what needs to be fixed.
Supported Validation Rules
You can apply the following validation rules to any form field. All rules are configured in the form builder — no coding is required.
| Rule | What It Does | Example |
|---|---|---|
| Required | The field must be filled in before the form can be submitted | A "Full Name" field that cannot be left blank |
| Type | The value must match the expected data type (text, number, etc.) | An "Age" field that only accepts numbers |
| Allowed Values | The value must be one of a predefined list of options | A "Department" dropdown limited to specific department names |
| Min / Max | A numeric value must fall within a specified range | A "Quantity" field that accepts values between 1 and 100 |
| Min / Max Length | Text must be within a specified character count | A "Bio" field with a maximum of 500 characters |
| Pattern | Text must match a specific format | A "Phone Number" field that requires a particular phone format |
| Format | Semantic validation for common data formats | An "Email" field that checks for a valid email address, or a "Website" field that checks for a valid URL |
Nested Field Validation
Forms can contain grouped fields — for example, an address group with separate fields for street, city, state, and zip code. When you use grouped fields, each sub-field is validated independently. If the city is missing but the zip code is valid, only the city field shows an error.
This means users see targeted feedback on exactly which part of a grouped field needs attention, rather than a single generic error for the entire group.
How Errors Are Displayed
When validation catches a problem, the error is displayed directly next to the relevant field with a clear message explaining what is wrong. For example:
- A required field left blank shows: "This field is required"
- An invalid email shows: "Must be a valid email address"
- A number outside the allowed range shows the minimum or maximum value allowed
- Text exceeding the character limit shows the maximum length allowed
Error messages are designed to be clear and actionable, telling the user exactly what to fix. The field itself is visually highlighted so it is easy to spot, even in long forms.
When Validation Runs
Validation runs at two key moments:
- On submission — When the user clicks the submit button, all fields are validated at once. If any field fails, the form scrolls to the first error and prevents submission.
- On field change — As users fill out the form, individual fields can be validated in real time, providing immediate feedback as they move from one field to the next.
For details on how fields and their types are defined, see Schemas. For information about the input controls that display validation errors, see Controls.