How to override default validation messages in angular or through formio portal?
See original GitHub issueHi Team, I’m using angular-formio package in my project and wanted to know how and where should I override the custom validation messages. I’m creating forms through formio portal and with the help of the above package, integrating it to angular.
Html looks something like this
<formio [form]="Form" (submit)="formSubmit($event)" (customEvent)="formCustomEvent($event)"></formio>
In formio documentation there’s a solution on how to override default error messages when we’re creating forms in javascript.
Formio.createForm(document.getElementById('formio'), 'https://examples.form.io/translations', { readOnly: false, language: 'en', i18n: { 'en': { Submit: 'Complete' } }
But I can’t do it this way since I’m not creating forms in angular but with their portal. Could anyone tell me if there’s any simple way which I completely missed to override the default messages from portal or in angular? I could modify these messages from the package itself (updating i18n.js file in formiojs) but I don’t want to change anything from the package files since that isn’t a good way.
Thank you in advance.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
The Custom Error Message option is on the Validations tab in the component settings.
If you are looking to translate the error messages, you should use the i18n support to translate it which we do not have a UI on portal to enter. http://formio.github.io/formio.js/app/examples/language.html
Hi. Excuse me form.io team, but I have the same @paulmartinjoy issue. I don’t know how to set the error and success messages inside the form.io platform, and not using form.io js in my application. In adition, Im not only looking for setting the deffault error message, but to modiffy it deppending of the mistake (for example either is unique or another). I undersatand the custom error messages of each field, but I mean the main one. Thank you for your help.