Titan Form Validation Patterns: Field-Level, Form-Level, and Conditional Rules
Titan Form Validation Patterns: Field-Level, Form-Level, and Conditional Rules
Form validation in Titan operates at three levels: individual fields, the form as a whole, and conditional rules that change validation behavior based on user input. Understanding all three layers is essential for building forms that catch errors early and guide users to a successful submission.
Layer 1: Field-Level Validation
Every Titan form field supports built-in validation through its properties. The most important settings:
- mandatory: true – field must have a value before the form submits
- Type-specific validation – Email fields validate format automatically, Phone fields support country-specific patterns, Number fields enforce min/max bounds
- Error indicators – set
hideErrorIndicator: falseto show visual feedback (red border, error icon) when validation fails - Success indicators – show a green checkmark when the field passes validation, giving immediate positive feedback
Field Type Validation Map
| Field Type | Built-in Validation |
|---|---|
| Valid email format (regex) | |
| Phone | Country-specific format detection |
| Number / Currency | min, max, decimal places |
| Date | disablePast, disableFuture, locale |
| File Upload | File count limit, MIME type, extension |
| Lookup | Valid Salesforce record reference |
Layer 2: Form-Level Validation
Form-level settings control how validation is enforced across all fields:
- ignoreValidation: false – the form will not submit until all mandatory fields are valid
- showErrorMessage: true – display a summary error message when submission fails
- showSuccessMessage: true – confirm successful submission with a visible message
For stepper (multi-step) forms, validation is enforced per step. The user cannot advance from Step 1 to Step 2 until all mandatory fields in Step 1 pass validation. This prevents the frustrating experience of discovering errors on a previous step after reaching the end.
Layer 3: Conditional Validation Rules
Conditional rules are the most powerful validation layer. They allow you to change validation behavior based on other field values. The pattern is:
When [field A] [operator] [value], then [make field B mandatory / show field B / hide field B].
Common use cases:
- “Other” text field – when a dropdown value equals “Other”, show and require a free-text field
- Conditional required fields – when “Contact Method” equals “Phone”, make the Phone field mandatory
- Cross-field validation – when “End Date” is before “Start Date”, show an error
- Dependent picklists – when “Country” changes, update the “State” dropdown options
Best Practices
- Validate early, not late – show errors as soon as the user leaves a field, not when they click Submit
- Combine Titan and Salesforce validation – Titan catches format errors before the Push, Salesforce catches business logic errors
- Test with empty submissions – click Submit with no data to verify every mandatory field shows an error
- Test conditional paths – verify that hiding a field also removes its mandatory requirement
Related Articles
Explore Our Services
Need solid form validation? Contact Titanixforce – we build forms that users complete on the first try.