Custom textbox for Google transliteration using JS array

by barkkathulla 2013-09-12 19:32:12



<script type="text/javascript" src="http://www.google.com/jsapi"></script>

function onLoad() {
var options = {
sourceLanguage:
google.elements.transliteration.LanguageCode.ENGLISH,
destinationLanguage:
[google.elements.transliteration.LanguageCode.TAMIL],
shortcutKey: 'ctrl+g',
transliterationEnabled: true
};

var control =
new google.elements.transliteration.TransliterationControl(options);



The custom textbox array is given,


var textFields=new Array("titleText","textfield",username","location","actors","greeting_title","greeting_tags");

for (var i = 0; i < textFields.length; i++) {
var text=textFields[i];
if ($('#'+text).length) {
control.makeTransliteratable([text]);
}
}

}
google.setOnLoadCallback(onLoad);


936
like
0
dislike
0
mail
flag

You must LOGIN to add comments