validators:VALIDATOR_NAME:message directive for the fields.ini file
Return to fields.ini file
Synopsis
If you want to customize the error message associated with a particular validation rule you can use the validators:VALIDATOR_NAME:message directive in the fields.ini file.
Format
[myfield]
validators:VALIDATOR_NAME:message = MESSAGE
Examples
If you don’t like the default error message that is displayed when you make the first_name field required, you can customize it with your own message. E.g.
[first_name]
validators:required=1
validators:required:message = "Please enter your first name"
See Also
- validators - The fields.ini file directive for adding a validation rule to a field. This directive must be used in conjunction with validators.
- fieldname__validate - For more complex validation rules you can define them in the table delegate class.
- Form Validation - Section in the Getting Started tutorial on form validation.