Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validation message shows field names in lowercase always! #467

Open
rajat-arora084 opened this issue Aug 4, 2023 · 1 comment
Open

Validation message shows field names in lowercase always! #467

rajat-arora084 opened this issue Aug 4, 2023 · 1 comment

Comments

@rajat-arora084
Copy link

rajat-arora084 commented Aug 4, 2023

When I try to show validation messages on a field. It shows the field name in lowercase.
Can it be shown as per the field name?

Example: My field name is: Mobile Number

image
@fxgit
Copy link

fxgit commented Sep 27, 2023

class NewSimpleReactValidator extends SimpleReactValidator {
  constructor(options = {}) {
    super(options);

    this.helpers.humanizeFieldName = (field) => {
      // startCase is a Lodash method
      return _.startCase(field.replace(/([a-z0-9])([A-Z])/g, '$1 $2').replace(/_/g, ' '));
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants