I am working on a simple PHP website where the user has to enter data in a form,
and if the user didn't enter Arabic letters I want to show a warning message "Arabic only" , I tried using the code below but it shows the warning message if I entered both Arabic or English letters.
<script>
function myFunction(){
var isArabic = "/[\u0600-\u06FF\u0750-\u077F]/";
var x = document.forms["myForm"]["fname"].value;
if(x != isArabic){
alert("arabic only");
return false;}}
</script>