AnsweredAssumed Answered

How to use $.ajax function in nintex list forms.?

Question asked by sagarnesarikar1987@outlook.com on Oct 27, 2014
Latest reply on May 5, 2016 by achilles.aditya

i want to implement auto-complete text box for stock tickers inside nintex list forms.

I am trying to develop the autocomplete textbox using jquery ui. for that purpose i used $.ajax function to call the external yahoo finance api url.

the code is as follows.

var YAHOO = {

        Finance: {

            SymbolSuggest: {}

        }

    };

             

 

 

NWF$(document).ready(function(){

 

 

var txtareaTicker= '#'+idTicker;

    NWF$( "#txtareaTicker" ).autocomplete({

source: function (request, response) {

var query=request.term; 

NWF$.ajax({

              type: "GET",

              url: "http://d.yimg.com/autoc.finance.yahoo.com/autoc",

              data: {query: query},

              dataType: "jsonp",

              jsonp : "callback",

              jsonpCallback: "YAHOO.Finance.SymbolSuggest.ssCallback",

          });

          // call back function

          YAHOO.Finance.SymbolSuggest.ssCallback = function (data) {          

                var suggestions = [];

                //alert(JSON.stringify(data.ResultSet.Result));                           

                NWF$.each(data.ResultSet.Result, function(i, val) {                                                                

                    suggestions.push("Name:"+ val.name+" #Symbol:"+val.symbol+" #Exchange:"+val.exchDisp);

                });

              

            response(suggestions);

          }

},

minLength: 1,

select: function (event, ui) {

               //alert(ui.item.value.split("#")[1]);

               NWF$(".clsTicker").val(ui.item.value.split("#")[0]);

               //$("#stockvalue").val(ui.item.name);         

},

});

 

 

 

 

});

 

When i don't use $.ajax function and uses simple jquery.ui autocomplete it works fins inside nintex forms.

is there any problem with ajax function inside nintex forms.

 

please help me out.

thanks in advance

Outcomes