Rename field names in Kendo Validator generated error message

1 Answer 271 Views
General Discussions
eleven
Top achievements
Rank 1
Iron
eleven asked on 14 Feb 2023, 03:33 PM | edited on 14 Feb 2023, 03:40 PM

Hi, I can't seen to find a fix for this:

I'm using .NET Core Telerik UI's Wizard feature along with its kendoValidator and the latter seems to be generating error messages, one example being the email address field - it'll generate an error message if the email doesn't follow the format allowed per the attributes in the view model. However, it's using the original field names despite my using the DISPLAY attribute in the VM. How can I go about changing the field name used in the client side when kendoValidator kicks in?

Example: ALT_EMAIL is not valid email. I'd like for it to say, This email address is not an valid email, instead.

 

FYI, I'm using .NET's tag helpers, not Telerik's, to generate the field names, inputs, etc.

1 Answer, 1 is accepted

Sort by
0
Mihaela
Telerik team
answered on 17 Feb 2023, 12:03 PM

Hi,

At this stage, when the EmailAddress DataAnnotation and a custom error message is provided, the message is not obtained through the Kendo UI Validator in comparison to the Required Annotation:

[Required(ErrorMessage = "This email address is required.")]
[EmailAddress( ErrorMessage = "This email address is not an valid email, instead")]
public string ALT_EMAIL { get; set; }

 

This behavior is already logged in the kendo-ui-core repo. You could follow the item's progress here:

https://github.com/telerik/kendo-ui-core/issues/7158

In the meantime, check out the possible workarounds described in the following forum thread:

https://www.telerik.com/forums/validator-not-showing-emailaddress-attribute-error-message

Thank you for your understanding regarding the matter.

 

Regards, Mihaela Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
eleven
Top achievements
Rank 1
Iron
Answers by
Mihaela
Telerik team
Share this question
or