pierallard
pierallard

Reputation: 3371

jQuery autocomplete doesn't send any request

I already created many autocomplete, and there has never been a problem. This time, I tried to insert an autocomplete in an existing page (very complex and having many javascript calls)

My code is simple like that :

$('#named_invitees_0_user_id').autocomplete({
  source: 'www.bidon.com'
});

I tried to :

In this 2 cases, my input 'understand' my autocomplete function, because it takes some of autocomplete specific attributes

<input id="named_invitees_0_user_id" name="named_invitees[0][user_id]" type="text" value="aaaa" autocomplete="off" class="ac_input">

But NO request is never send when I wrote something on my input (regarding the Firebug Network activity). I think some of the javascript already present on the page is tracking control of this query, but I have no idea what it can be.

And you ?

Edit:

Thanks to your replies. I follow your suggestions :

Edit2:

Problem found !

There was an hidden JS code somewhere... An old "autocomplete" jquery include. Result : 2 autocomplete were defined. I delete this hidden code and everything works ok !

Thanks for your replies.

Upvotes: 2

Views: 1150

Answers (1)

codefreak
codefreak

Reputation: 7141

Make sure your source is outputting proper json.

check http://jqueryui.com/autocomplete/#remote for documentation and sample code

here's an example:

 $( "#named_invitees_0_user_id" ).autocomplete({
      source: "search.php",
      minLength: 2
    });

use ":" after source!

Upvotes: 1

Related Questions