Qustion:
I am using a web application input page where the user enters name in English from SQL table and upon pressing tab on the English name I am displaying the name in different language in another textbox that has direction from right to left. some times I need to enter names that are not found in the database. in this case, I need when pressing tab from the English name; to change the RTL ction (RTL) And language (Ar-sa) in the second name automatically without the user pressing right Alt + shift to change the direction and language. Is this possible with a JavaScript or CSS? Thanks
My answer 1:
I think the imemode of CSS can do this
Pls. Try the following code, hope this helps:
Onfocus = "This. style. imemode = 'Disabled '"
Auto: IME is not affected. This is the same as not specifying the ime-mode attribute.
Active: All characters are entered through the ime. Users can still deactivate the ime.
Inactive: All characters are entered without ime. Users can still activate the ime.
Disabled: IME is completely disabled. Users cannot activate the ime if the control has focus.
My answer 2:
1. Declare API functions:
Functionbooleanimmsimulatehotkey (ulonghwnd, ulongdwhotkeyid) Library "imm32.dll"
Functionulonggetkeyboardlayout (ulongdwlayout) Library "user32.dll"
Functionbooleanimmisime (ulonghklkeyboardlayout) Library "imm32.dll"
2. DeclareVariable:
Constantintime_thotkey_ime_nonime_toggle = 112
Ulonghklcurrent
Ulonghnd
3. Change to English:
Hklcurrent = getkeyboardlayout (0)
Ifimmisime (hklcurrent) then
HND = handle (parent)
Immsimulatehotkey (HND, ime_thotkey_ime_nonime_toggle)
Endif
4. Change to other language:
Hklcurrent = getkeyboardlayout (0)
Ifnotimmisime (hklcurrent) then
HND = handle (parent)
Immsimulatehotkey (HND, ime_thotkey_ime_nonime_toggle)
Endif