Home

Friday, February 22, 2013

How to type in Hindi or Gujarati language in text box

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>How to type in Hindi or Gujarati language in text box</title>  
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
      // Load the Google Transliterate API
      google.load("elements", "1", {
            packages: "transliteration"
          });
      function onLoad() {   
var options = {
          sourceLanguage: 'en',
          destinationLanguage: ['gu'],        
          transliterationEnabled: true
        };  
     
var control = new google.elements.transliteration.TransliterationControl(options);
var ids = [ "first_name", "last_name" ];
control.makeTransliteratable(ids);
      }
      google.setOnLoadCallback(onLoad);
    </script>
</head>
Working Demo :
    <table width="50%" style="border:1px solid #06F;background-color:#CFC">
    <tR>
        <td>પહેલું નામ :</td>
            <Td><input type="text" name="first_name" id="first_name"></Td>
        </tR>
        <tR>
        <td>અટક :</td>
            <Td><input type="text" name="last_name" id="last_name"></Td>
        </tR>
    </table>
How to type in Hindi or Gujarati language in text box Working Demo :
પહેલું નામ :
અટક :

No comments:

Post a Comment

rathoddhirendra.blogspot.com-Google pagerank and Worth