Click here to Skip to main content
15,901,035 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have jquery validation engine and make a field as only letters ,when I write arabic letters in it give me only letters message how to add support for arabic letters as letters
Posted

You need to change the validation engine. It is likely using RegEx so you need to find one that supports arabic chars. But since you did not share any code we cannot tell you exactly what to do. Just some direction.
 
Share this answer
 
C#
(function($) {
        $.fn.arabicOnly = function(options) {
            return this.each(function() {
                var settings = {
                    dv: '',
                    ov: ''
                };
                if (typeof options == 'object') {
                    $.extend(settings, options);
                }
                $(this).keypress(function(e){
                    var key = e.charCode ? e.charCode : e.keyCode ? e.keyCode : 0;
                    if (key != 8 && key != ){
                        if ((key < 0x0600 || key > 0x06FF)) //if not an arabic letter
                            return false;
                    }
                });
            });
        };
    })(jQuery);
    $('.onlyletters').arabicOnly();


still under development for other scenarios, but you can use it as it is :)
good luck
Feras Jobeir
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900