Reputation: 21
I want to validate the text of customer input using jQuery. If the customer enter Arabic text I would like to show message in Arabic. How can I do that?
Upvotes: 1
Views: 2178
Reputation: 4903
Try this:
isArabic('Some Text');
function isArabic(strInput)
{
var arregex = /[\u0600-\u06FF]/;
if (arregex.test(strInput)){
alert('Yes, Has Arabic Characters');
}else{
alert('No, Has Not Arabic Characters');
}
}
Upvotes: 10