how set keyboard language in textbox into asp.net [Resolved]

Posted by Cpatil1000 under ASP.NET on 7/25/2016 | Points: 10 | Views : 259 | Status : [Member] | Replies : 1
Hi,

I our client want to write some comment in hindi / english. if he selected in hindi them it is
starting type in hind or if he selecte english then starting typing in english. In our application
when form load it is starting english because default is english, But if he select hindi then it is
starting hindi also. But problem is that when i select english then it not support to english typing


Javascript code :

<script type="text/javascript">
// Load the Google Transliterate API
google.load("elements", "1", {
packages: "transliteration"
});

function CallonLoad() {
// Create an instance on TransliterationControl with the required
// options.
var varComment = $("input[name='<%=rblLanguage.UniqueID%>']:checked").val();

if (varComment == 0) {
var optionsEng = {
sourceLanguage:
google.elements.transliteration.LanguageCode.ENGLISH,
destinationLanguage:
[google.elements.transliteration.LanguageCode.ENGLISH],
shortcutKey: 'ctrl+g',
transliterationEnabled: true
};

var control = new google.elements.transliteration.TransliterationControl(optionsEng);
}
else if (varComment == 1) {
var optionsMar = {
sourceLanguage:
google.elements.transliteration.LanguageCode.ENGLISH,
destinationLanguage:
[google.elements.transliteration.LanguageCode.MARATHI],
shortcutKey: 'ctrl+g',
transliterationEnabled: true
};

var control = new google.elements.transliteration.TransliterationControl(optionsMar);
}
// Enable transliteration in the textbox with id
// 'transliterateTextarea'.
control.makeTransliteratable(['<%=tbComment.ClientID%>']);
}
google.setOnLoadCallback(CallonLoad);
</script>



aspx form
=========
 <div id="Div1" class="row" runat="server">
<div class="col-sm-7 form-group">
<b>Language</b>
<asp:RadioButtonList ID="rblLanguage" runat="server" RepeatDirection="Horizontal"
CellPadding="20" onclick="CallonLoad()">
<asp:ListItem Value="0" Selected="True">English&nbsp &nbsp</asp:ListItem>
<asp:ListItem Value="1">?????</asp:ListItem>
</asp:RadioButtonList>
</div>
</div>
<div class="row" runat="server">
<div class="col-sm-7 form-group">
<b>Comments</b>
<asp:TextBox ID="tbComment" TextMo




Responses

Posted by: Bhuvanesh6 on: 7/26/2016 [Member] Starter | Points: 50

Up
0
Down

Resolved
Please refer this link for the sample code, where the text area support for multiple language, this is for windows application.
Download and use the code logic in your application.

http://www.codeproject.com/Articles/10930/Multilingual-TextBox

Bhuvan

Cpatil1000, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response