【问题标题】:I have to save both Hindi and English Languages fields simultaneously User will type我必须同时保存印地语和英语语言字段用户将输入
【发布时间】:2016-05-23 20:36:15
【问题描述】:

如果用户键入印地语,则应在另一个文本文件上用英语填写文本,以便我保存以进一步检索。当我输入并留出空格时,以下代码会立即转换为英语或印地语。请帮我保留印地语和英语信息。

<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <script type="text/javascript" src="http://www.google.com/jsapi"></script>  
    <link href="http://www.google.com/uds/modules/elements/transliteration/api.css" type="text/css" rel="stylesheet"/>

    <script type="text/javascript">
      // Load the Google Transliteration API
      google.load("elements", "1", {
            packages: "transliteration"
          });
      function onLoad() {
        var options = {
            sourceLanguage:
                google.elements.transliteration.LanguageCode.ENGLISH,
            destinationLanguage:
                [google.elements.transliteration.LanguageCode.HINDI],
            shortcutKey: 'ctrl+g',
            transliterationEnabled: true
        };

        // Create an instance on TransliterationControl with the required
        // options.
        var control =
            new google.elements.transliteration.TransliterationControl(options);

        // Enable transliteration in the textbox with id
        // 'transliterateTextarea'.
        control.makeTransliteratable(['transliterateTextarea']);
      }
      google.setOnLoadCallback(onLoad);
    </script>
  </head>
  <body>

    Type in Hindi (Press Ctrl+g to toggle between English and Hindi)<br>
    <a href="#" onclick="document.getElementById('Wrapper').style.display = 'block'; return false;">show textarea</a>
    <div id="Wrapper" style="display:none"> <h2> Textarea </h2>
    <textarea id="transliterateTextarea" style="width:600px;height:200px"></textarea>
    <textarea id="transliterateTextarea2" style="width:600px;height:200px"></textarea>
    </div>
  </body>
</html>

【问题讨论】:

标签: javascript


【解决方案1】:

【讨论】:

  • 感谢 Sujeet Sinha 兄弟
猜你喜欢
  • 1970-01-01
  • 2023-04-08
  • 1970-01-01
  • 1970-01-01
  • 2016-07-09
  • 1970-01-01
  • 2017-11-06
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多