$(function () { $("#ContentPlaceHolder1_TenderListing1_txtKeyword").autocomplete( { source: function (request, response) { var hdnLanguageID = document.getElementById('ContentPlaceHolder1_TenderListing1_hdnLanguageID'); var hdnSiteId = document.getElementById('ContentPlaceHolder1_TenderListing1_hdnSiteID'); $.ajax({ url: "AutoCompleteService.asmx/AutoSugessionListforTender", data: "{ 'SearchText': '" + request.term + "' , 'SearchType':'Tender','siteId': '" + hdnSiteId.value + "', 'languageId':'" + hdnLanguageID.value + "' }", dataType: "json", type: "POST", contentType: "application/json; charset=utf-8", dataFilter: function (data) { return data; }, success: function (data) { response($.map(data.d, function (item) { return { value: item } })) }, error: function (XMLHttpRequest, textStatus, errorThrown) { // alert(textStatus); } }); }, minLength: 1 }); });
//---- English to Hindi Conversation var hdnLanguageID = document.getElementById('ContentPlaceHolder1_TenderListing1_hdnLanguageID'); if (hdnLanguageID.value == '2') { google.load("elements", "1", { packages: "transliteration" }); function onLoad() { var options = { sourceLanguage: 'en', destinationLanguage: ['hi'], shortcutKey: 'ctrl+g', transliterationEnabled: true }; var control = new google.elements.transliteration.TransliterationControl(options); control.makeTransliteratable(['ContentPlaceHolder1_TenderListing1_txtKeyword']); } google.setOnLoadCallback(onLoad); } //-----------------------------------