in which call back function should we call another AJAX call in jquery autocomplete
NickName:user739115 Ask DateTime:2015-06-11T09:27:34

in which call back function should we call another AJAX call in jquery autocomplete

autocomplete functionality working when i search the companies.when i select the company i need to call another AJAX call to get deparments which are related to that company.where should i place that call.Is it in onselect or onchange function.

 $("#company").autocomplete({
    source: function( request, response ) {
       $.ajax({
          url: "findByCompanyName",
          data: {"company": request.term},
          dataType: "json",
          success: function( data ) {
              response( $.map( data, function( item ) {
                 return {
                    label: item.company,
                    value: item.company,
                    companyid: item.companyId
                 }
              }));
          }
       });
    },
    minLength: 1,
    select: function(event, ui) {
        $('#eventCompany').val(ui.item.company);
        $('#companyName').val(ui.item.company);
        $('#companyId').val(ui.item.companyId);
    }
});

Copyright Notice:Content Author:「user739115」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/30770068/in-which-call-back-function-should-we-call-another-ajax-call-in-jquery-autocompl

More about “in which call back function should we call another AJAX call in jquery autocomplete” related questions

in which call back function should we call another AJAX call in jquery autocomplete

autocomplete functionality working when i search the companies.when i select the company i need to call another AJAX call to get deparments which are related to that company.where should i place that

Show Detail

Is there a way to call abort() on a jQuery Autocomplete AJAX call?

I'm trying to build a "cancel" link to a jQuery autocomplete field for a large database call. In case it takes too long, it'd be nice if there were a way to cancel the AJAX call that the autocomple...

Show Detail

On autocomplete select, should display the ajax call response

I am using autocomplete jquery function to get contents on a search box. I'm doing one ajax call(ajax1) to get the contents for autocomplete the search box, on select of any of the contents,I am ...

Show Detail

Attach JQuery Autocomplete to a text field which is loaded by Ajax call

I have a simple web application in which I have created a wizard, each wizard page contains different form fields which are populated from database, as user presses next the page data is retrieved ...

Show Detail

Retrieve value of Jquery autocomplete into Ajax call

I have a jquery autocomplete field in index.php page : $html .= '<div class="ui-widget"> <label for="tags">Tags:</label> <input id="tags" /&g

Show Detail

jquery autocomplete with an ajax call to generate the array

i'm trying to do a jquery ui autocomplete with some countries i get from db with an ajax call I'm struggling on how to pass my table of values to the autocomplete $( document ).ready(function() ...

Show Detail

Jquery Autocomplete: the value passed to the ajax call is wrong

I have a reusable function of jquery Autocomplete in a file function.js. The function has as parameters the url for the ajax call and some additional values ​​taken from the fields of a form In an...

Show Detail

Call Jquery Autocomplete ajax function

I have a Jquery autocomplete ajax function whose source is calculated from code behind. however I am getting the source in javascript using client script manager but my function doesn't execute. ...

Show Detail

jquery ajax should call function

jquery ajax should call testing(propertyLevelId) function. function name(roleId) { $.ajax({ url: '../UserManagement/GetRoleLevel' + '/?roleId=' + roleId, type: "POST", dataType:

Show Detail

JS autocomplete will not work when input is from an ajax call

I searched and searched but could not find anything similar. Pointers if I'm wrong, please. Not sure how to post this without supplying 'a wall of code'. Code is PHP, javascript ajax, jquery

Show Detail