Jump to content

jquery tokenizing autocomplete troubleshooting


sfraise

Recommended Posts

I'm playing with this tokenizing autocomplete script but am having a strange issue with it.

 

It all seems to work ok and it's pulling the values over from the php file that's doing the db query ok and if you put in a value that doesn't match it will tell you so, however if you do type in a value that matches it simply disappears.

 

This script is exactly like the demo script except for the paths to the js, css, and php files, and I did remove the 1st example but was having this issue before removing it. No changes made to the js file, php file is identical to the demo just with my own db info and table info put in, and no changes to the css file compared to the demo.

 

I've tried this both with jquery 1.3.0 and 1.4.2 and have the same issue with both.

 

Here is the link to my test page:

http://www.erecoverydev.com/autocomplete2/autocomplete.html

Here is my js file:

http://www.erecoverydev.com/autocomplete2/jquery.tokeninput.js

Here is my php code:

<?
mysql_pconnect("localhost", "myuser", "mypass") or die("Could not connect");
mysql_select_db("mydb") or die("Could not select database");

$query = sprintf("SELECT cb_activities from jos_comprofiler WHERE cb_activities LIKE '%%%s%%' ORDER BY cb_activities DESC LIMIT 10", mysql_real_escape_string($_GET["q"]));
$arr = array();
$rs = mysql_query($query);

while($obj = mysql_fetch_object($rs))
{
    $arr[] = $obj;
}

echo json_encode($arr);
?>

A couple of values that are in my table are web development and kicking cats if you want to test it.

 

Here is the link to the demo:

http://loopj.com/tokeninput/demo.html

 

It just doesn't make any sense to me why the demo works and mine doesn't when they are basically identical.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.