Waqar Ahmed
Waqar Ahmed

Reputation: 203

Automatically change input language

i am trying to build an web application in which i want to take inputs in two language english and urdu.

<asp:TextBox ID="txturdu" runat="server"></asp:TextBox>
<asp:TextBox ID="txtenglish" runat="server"></asp:TextBox>

So what i am trying to do is when i click on textbox (txturdu) it automatically takes input in urdu language.

Upvotes: 0

Views: 960

Answers (1)

George Botros
George Botros

Reputation: 4399

1 - Listen to key press event
2 - Detect pressed key code example
3 - Translate the pressed key code to the Urdu character (may be you can use Array[code,character] here)
4 - Add the character to yourtextbox.Text don't forget to call event.preventDefault();
to prevent adding the character in the default language again

Upvotes: 1

Related Questions