How to change TextBox input language to Persian as you type in

I am working on a website in which users should fill some fields in different languages. I don't want the users to change their writing language using Alt+Shift key combination but rather i want the input language to be changed automatically to either Persian or English.

Is there any way to do that?

Answers:

Answer

1- Download Farsi type java script file

After you downloaded the file, attach it to the head section of your html page.

<Head>
<script src="farsitype.js" type="text/javascript"></script>
<!-- Other tags are omitted to reduce complexity -->
</Head>

Now all you have to do is to create a text box and set its Lang attribute to "fa-IR".

<input type="textbox" name="text1" Lang="fa-IR" />

or

<asp:TextBox ID="txt_name" runat="Server" Lang="fa-IR" />

Load your page and it's done!

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.