Jquery CodeIgniter 2.X |
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
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. |
Welcome Guest, Not a member yet? Register Sign In |