Click here to Skip to main content
15,885,753 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
If user type k (lowercase) then textbox text is like 'क'
and
If user type K (uppercase) then textbox text is like 'ख'

I want to type in Indian Language in textbox.
So whenever user type English letter instead of texting in english; the english letter must convert/translate into Indian Language(Hindi).

I want to do this with using javascript

What I have tried:

I don't have any knowledge about javascript.
Posted
Updated 9-Mar-16 23:24pm

1 solution

Here is an example :
JavaScript code :
JavaScript
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
   <script type="text/javascript">
       google.load("elements", "1", { packages: "transliteration" });
   </script>

   <script>
       function OnLoad() {
           var currValue = document.getElementById("text1");

           var options = {
               sourceLanguage:
               google.elements.transliteration.LanguageCode.ENGLISH,
               destinationLanguage:
               [google.elements.transliteration.LanguageCode.HINDI],
               transliterationEnabled: true
           };


           var control = new

           google.elements.transliteration.TransliterationControl(options);
           control.makeTransliteratable(["text1"]);

       }

       google.setOnLoadCallback(OnLoad);

   </script>


Html code :
HTML
<form name="trans">
       <input type="text" id="text1" name="text1" />

   </form>


Reference : English to Hindi Translation | The ASP.NET Forums[^]

Good luck.
 
Share this answer
 
v2
Comments
Nilesh Dalvi 11-Mar-16 0:25am    
what will happen if internet connection lost OR not available?
Raje_ 11-Mar-16 1:32am    
Nothing will work. Not even your website. You are creating website not windows app. :)
Nilesh Dalvi 11-Mar-16 3:29am    
yes... but its offline website
run through local network connection only.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900