how call google translate onblur in asp.net [Resolved]

Posted by Cpatil1000 under ASP.NET on 11/10/2016 | Points: 10 | Views : 190 | Status : [Member] | Replies : 1
HI,
I want call google translate function onblur of textbox change. I am calling this function using javascript.

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

function onLoad() {
var options = {
sourceLanguage:
google.elements.transliteration.LanguageCode.ENGLISH,
destinationLanguage:
[google.elements.transliteration.LanguageCode.MARATHI],
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(['<%=tbFarmerName .ClientID%>', '<%=tbSearchSurveyNo .ClientID%>', '<%=tbSearchHissaNo .ClientID%>', '<%=tbSearchGathNo .ClientID%>', '<%=tbNewFarmerName .ClientID%>', '<%=tbAddress .ClientID%>', '<%=tbEditFarmerName .ClientID%>', '<%=tbEditAddress .ClientID%>', '<%=tbAssignTo .ClientID%>', '<%=tbContactNo.ClientID%>']);
}
google.setOnLoadCallback(onLoad);
}
</script>

<div class="col-sm-6 form-group">
<b>????????? ???</b><span style="color: Red; font-weight: bolder; font-size: medium;">*</span>
<asp:TextBox ID="tbNewFarmerName" runat="server" autocomplete="off" placeholder="Enter Farmer Full Name .." onblur ="changeEnglishToMarathi()"
class="form-control"></asp:TextBox>
</div>





Responses

Posted by: Rajnilari2015 on: 11/10/2016 [Member] [Microsoft_MVP] [MVP] Platinum | Points: 50

Up
0
Down

Resolved
We have written an article on the same (http://www.dotnetfunda.com/articles/show/3332/translate-english-text-to-hindi-and-bengali-through-google-translitera ) that may help you. Just invoke it on Blur.

Hope that helps.

--
Thanks & Regards,
RNA Team

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

Login to post response