We help IT Professionals succeed at work.

How to change the Language of a text filed to accpet one language as the Input Language

How to Change the Language in Javascript on clink of two Text Boxes. One shoiuld take English as Text and another as Arabic as text (Like Keyboard Shift and Alt Key)
Comment
Watch Question

RobOwner (Aidellio)
CERTIFIED EXPERT
Most Valuable Expert 2015

Commented:
Check your page encoding is utf-8

eg

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

then you should be able to type English into one textbox, change your input language on your computer and then type Arabic into the other textbox.

Author

Commented:
It doesn't solve the purpose.
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
is to tell the browser to render the content using UTF-8 encoding. It doesn't change the keyboard input language. We already have this tag in our HTML pages.

RobOwner (Aidellio)
CERTIFIED EXPERT
Most Valuable Expert 2015

Commented:
the browser has nothing to do with the input language, this is solely determined by your operating system.  If you have the correct keyboard then you will be able to enter the language

Author

Commented:
Sample
I've attached the screenshot of one of our screen. All of our HTML/JSP pages has UTF-8 encoding.

Now user is keying the input by changing the input language by Alt+Shift keys.

Now, we need to make this automated by switching the keyboard language programatically based the field he is in.
Owner (Aidellio)
CERTIFIED EXPERT
Most Valuable Expert 2015
Commented:
you can force the alt and shift keys to be on when the user puts focus on the arabic textbox

http://www.webdeveloper.com/forum/showthread.php?t=81340

http://bytes.com/topic/javascript/answers/560745-how-toggle-keyboard-input-language

Explore More ContentExplore courses, solutions, and other research materials related to this topic.