• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Jquery CodeIgniter 2.X

#1
Hello,

I have a mistake in my dev that i don' t understand.
I have a form which is link to a controler projet/formulaire

In this form i have an input text with an ID="ref".

I want to use

$('#ref").autocomplete({
source: "<?php site_url('projet/autocomplete') ?>
})

But when I type one cheracter in my input text nothing happen.
In public function projet/autocomplete i put a javascript alert and it doesn't appear.
I think that it don't go to the projet/autocomplete

Somebody have an idea.
Have a nice
Best
Reply

#2
Autocomplete is an ajax request so your contoller needs to echo results. Also you are using it wrongly as you need to define the serviceUrl: which returns the option data or provide the option data manually.

Have a look here:
https://www.devbridge.com/sourcery/compo...ocomplete/

Or the API docs
http://jqueryui.com/autocomplete/

Hope that helps,

Paul.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.