I'm creating a website (Speedy Net) in 2 languages - English and Hebrew. I have an input field (the slug/username) which must be in English (alphanumeric Latin characters). When I enter the website from my mobile phone, I can write text in Hebrew. Is it possible to force the keyboard to be in English in this input field? I noticed that for the email address (email input) the keyboard is already in English.
Update: On the server side we do validate the input. I don't want to validate the input on the client side (with JavaScript) or prevent the user from typing Hebrew characters (this may be done later maybe), but I want to cause (force) the default keyboard language to be in English. I noticed that for the email and password, when I set their direction to ltr
, the keyboard's default language is English. But not on the slug/username fields.
The email input is automatically validated to be in English by the browsers I tested. You can't use Hebrew characters there.
I searched and didn't find a similar question on Stack Overflow or elsewhere.
The slug field may contain any non-alphanumeric characters which are converted by the server to dashes. For example Aa=Bb!1@2#3$4%56
is converted by the server to aa-bb-1-2-3-4-56
, which is a valid slug of a user on Speedy Net. However, אא-בב-1-2-3-4-56
is not a valid slug on Speedy Net. A slug of a user must start with at least 4 Latin letters.
The problem arises when the page is in Hebrew. If the page is in English, there is no problem.
In my website when typing the first & last name, the user can type in any language. When typing the email address (email input), the keyboard switches automatically to English (tested on Galaxy). But when typing the slug/username (which is after the email address), the keyboard switches back to Hebrew if it was in Hebrew before the email input (on Galaxy). This is what I want to prevent.