question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to override default validation messages in angular or through formio portal?

See original GitHub issue

Hi 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:closed
  • Created 3 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
randallknutsoncommented, Oct 1, 2020

The Custom Error Message option is on the Validations tab in the component settings.

Form_IO

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

0reactions
fvillarrealpcommented, Jun 18, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Form Components - Form.io Documentation
To edit a form component on a form, hover over the component and click the gear icon. You will then be presented with...
Read more >
Validating form input - Angular
This page shows how to validate user input from the UI and display useful validation messages, in both reactive and template-driven forms.
Read more >
Form Components - Form.io Help | User's Guide
To edit a form component on a form, hover over the component and click the gear icon. You will then be presented with...
Read more >
How to reset validation error without resetting form in angular?
Reset FormGroupDirective in the onSubmit method with reactive form reset. this.formGroupDirective.resetForm(); <br> this.form.reset();.
Read more >
formio/formio - Gitter
Hi @travist and everyone, I am implementing a Custom Component using AngularJS 1.x and ui-select (an implementation of jQuery's Select2 for Angular).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found