Saving and validation
VX never gets in the way of saving a post. Most rules on a field (a maximum length, a minimum number of rows, a URL format) produce warnings. The value is saved, and the field shows what doesn't meet its rules so you can fix it later.
Warnings
A warning appears under the field after you edit it, and again when you save. Warnings don't stop the post, term or user from saving. They cover things like:
- text that is longer or shorter than the field allows
- a number outside its minimum or maximum
- too many or too few items, rows, files or selections
- an email, URL or phone number in the wrong format
- a date range whose end comes before its start
Errors
A few problems mean the value can't be stored at all. The rest of the form still saves, but that field doesn't:
- a file whose type isn't allowed, or whose extension is blocked
- an attachment that no longer exists
- a Content sections row whose layout has been removed from the field
- an Area shape with more points than the field allows
No required fields
VX fields have no "required" setting. An empty field is always allowed, so editors can save a draft half-finished and come back to it. If a value must be present before something is published, check for it in your theme or workflow.
Hidden fields are left alone
When conditional logic hides a field, the field is skipped completely when you save: it isn't validated, overwritten or cleared. Whatever was stored before stays, and returns when the field is shown again.
Saving on option pages
Option pages have their own Save button, which waits for the save to finish and then reports the result. Leaving the page without saving discards your changes.
Technical details for LLMs
- Hard errors (value dropped, field not written):
Invalid file value.,Attachment not found.,File type is not allowed.,File extension is blocked., and malformed rows. - Warnings (value saved): every declarative rule —
minlength,maxlength,html_minlength,html_maxlength,min,max,min_items,max_items,min_files,max_files,min_count,max_count,item_minlength,item_maxlength,pattern,phone,date_range_order. Exception: a field type may enforce its ownmax_count; see that field's article. - Required: the
requiredconfig key is stored with the field and not checked on save. - Dry run: the fieldset values validate endpoint and the value abilities report
errorsandwarningswithout writing. Rules added withvxframework/fieldsets/validation_rulesare checked on save as warnings too (Custom validation).