In JavaScript, you can create functions to validate and restrict user input to a specific language.

Just Add Class 'eng_only' to input for enforcing accept English letters ,
and add Class 'arb_only' to input for enforcing accept Arabic letters
JS Code
<script>
$(document).ready(function (){
$(".eng_only").keypress(function(event){
var ew = event.which;
if(ew == 32)
return true;
if(48 <= ew && ew <= 57)
return true;
if(65 <= ew && ew <= 90)
return true;
if(97 <= ew && ew <= 122)
return true;
return false;
});
$(".arb_only").keypress(function(event){
var inputValue = $(this).val();
var validChars = /^[\u0600-\u06FF\s]+$/;
if (!validChars.test(inputValue))
{
// Remove invalid characters
$(this).val(inputValue.replace(/[^\u0600-\u06FF\s]+/g, ''));
}
});
})
</script>
HTML Code
<input type='text' class='eng_only'>