Articles in this section
Category / Section

How to localize the validation messages in Grid?

1 min read

You can localize the validation messages in Grid by modifying messages properties of jQuery validator.

 

Solution               

Grid Control uses jQuery Validation plugin to show validation messages during CRUD operation.               

Those validation messages can be localized by modifying the messages properties of jQuery validator, using extend method of jQuery

$.extend($.validator.messages, {
    required: "هذا الحقل إلزامي",
    number: "رجاء إدخال عدد بطريقة صحيحة",
    maxlength: $.validator.format("الحد الأقصى لعدد الحروف هو 5"),
    minlength: $.validator.format("الحد الأدنى لعدد الحروف هو 3"),
    rangelength: $.validator.format("عدد الحروف يجب أن يكون بين 1, 1000"),
    range: $.validator.format("رجاء إدخال عدد قيمته بين 1, 1000"),
    max: $.validator.format("رجاء إدخال عدد أقل من أو يساوي 5000"),
    min: $.validator.format("رجاء إدخال عدد أكبر من أو يساوي 100")
});

 

Alternatively, jQuery-validation localization files can downloadable from following location.

https://github.com/jquery-validation/jquery-validation/tree/master/src/localization

 

The following screenshot displays the Grid control with localized validation message.

Figure: Grid with localized validation message

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied