Open Closed

Customize/Disable Default Model Entity Validation Message in Angular #3059


User avatar
0
shijo created
  • ABP Framework version: v5.2.1

  • UI type: Angular

  • DB provider: EF Core

  • Tiered (MVC) or Identity Server Separated (Angular): yes

  • Exception message and stack trace:

  • Steps to reproduce the issue:" How to change the default error validation message coming in angular UI during form submission? or How can I stop this validation, I used [DisableValidation] but still it is validating.

    public Guid BookLanguageId { get; set; }


3 Answer(s)
  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Hi @shijo

    The picture that you've posted, shows a json parsing error, it's not a validation error. That error occurs before the validation operation and that means, there is something wrong in bookLanguageId and it can't be parsed as Guid. **What do you send in that field? **

    Make sure that can be parsed as Guid, or if it is nullable, make sure your property is nullable too.

  • User Avatar
    0
    shijo created

    This property is not nullable and I marked Required with an error message. [Required(ErrorMessage ="Select a Book Language")] public Guid BookLanguageId { get; set; }

    I think I have to place angular form validators also. bookLanguage: [null, Validators.required],

  • User Avatar
    0
    enisn created
    Support Team .NET Developer

    Can you provide the json body of that request?

    This error shows there is a parsing error.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09