Note that there are some explanatory texts on larger screens.

plurals
  1. POAutocomplete with jquery and codeigniter php MVC
    text
    copied!<p>I'm trying to build an autocomplete using jquery plugin autocomplete from <a href="http://jquery.bassistance.de/autocomplete/demo/" rel="nofollow noreferrer">this</a> site. </p> <p>Now I managed to achieve autocomplete using local results pre-loaded into website as a part of document ready function, its quite easy doing it localy.</p> <p>Here is with what I struggle with, pulling results from php file. Here is how I tried:</p> <pre><code>$("#post_tags").autocomplete("http://localhost/tags/filter", { width: 260, selectFirst: false, highlight: false, multiple: true, multipleSeparator: " ", scroll: true, formatItem: function (row, position, totalReturned, searchTerm){ return row[0]; }, formatResult: function(row, position, totalReturned){ return row[0].replace(/(&lt;.+?&gt;)/gi, ''); } }).result(function(event, data, formatted){ $("&lt;li&gt;").html( !data ? "No match!" : "Selected: " + formatted) .appendTo("#result"); }); </code></pre> <p>When I manually go to <code>http://localhost/tags/filter/p</code> I get results php,asp because they contain letter p . </p> <p>How can I make this work with autocomplete, I mean its quite easy using native php see <a href="http://view.jquery.com/trunk/plugins/autocomplete/demo/search.phps" rel="nofollow noreferrer">this file</a> , meaning I'm only passing something to the search file like this <code>search?q=p</code> and I get back the results. Since I'm using codeigniter the things are a bit different and I don't retrieve any results using jquery code above.</p> <p>I'm stuck with this since last night I cannot yet offer a bounty and I really need it for monday. Thank you</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload