dimanche 28 juin 2015

regex pattern.test() works in chrome but not in IE8

I am checking regular expression in jquery part of my razor as below

function isValidarabicname(arabicname) {
    var pattern = new RegExp(/^[\u0600-\u06ff ]+$/);
    return pattern.test(arabicname);
};

$("#delBtn").on('click', function() {
    if (!isValidarabicname(arabicname)) {
        $("#errorDiv").show(500).html("Enter only arabic letters");
        $("#arabic_name").focus();
        error = 1;
    }
});

this validation is working fine in Chrome but it get failed in IE 8. Do i need to change anything to make it work in IE 8?

Aucun commentaire:

Enregistrer un commentaire