Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
Node is saved as draft in My Content >> Draft
  • Call ajax function on autocomplete in jquery

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 5
    Comment on it

    //Call ajax function on autocomplete in jquery

    $(document).ready(function(){ jQuery("#name").autocomplete({ source: function(request, response) { $.ajax({ url: 'include/get.php', type: "POST", data: { term : request.term, data :$("#form1").serializeArray() }, success: function(data) { data=JSON.parse(data); response(data); }
    }); }, minlength:1 }); }); Here onclick of field 'name' it calls an ajax file get.php where it sends the form data and the entered term. The response we get which is in json format is again parsed as

    data=JSON.parse(data);

    to get the result otherwise it shows jquery error,means the data is parsed as json twice to display the autocomplete result correctly.

    autocomplete jquery autocomplete ajax jquery ajax autocomplete

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: