Text field language check

Text field language check

  
Hi,
I have an application in both English and Chinese. However, the text entered in the input fields must be English-only, due to the back end system. Is there an action out there that can do this check for me?

Thanks...

Roy

Hi Roy,

What do you want to check exactly? Do you want to prevent that the user enters Chinese characters, or do you want to perform a back-end check on valid characters? The latter is easiest: use a regular expression to check for invalid characters.
Hi Kilian,

thanks for your reply! Indeed I want to prevent entering Chinese characters on the frontend. I thought of regex, but my problem with that is that I am not sure what to check on: only lower and upper case, numeric, interpunction etc. I was wondering whether such a function exists, especially because I foresee a requirement that in future only Chinese characters may be entered. And then I would be lost at see with regex.

Any other thoughts?


Hi Roy,

Allowing only Chinese would be even a worse nightmare I think, because what set of Chinese characters defined in unicode do you want to support? I bet not the obsolete stuff only used in 4th century poetry :). And probably also not the Japanese or Korean varieties. And so on and so forth. I think your best shot is to find a Chinese programmer, and see how this stuff is handeled normally in China.

As for the regex, that would be my best guess for allowing only "regular" Western characters. (And perhaps it's that easy for Chinese as well, if all the characters are in one or two contingious series of Unicode characters.)