Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Mar 2009
    Posts
    175
    Thanks
    3
    Thanked 1 Time in 1 Post

    jquery tokenizing autocomplete troubleshooting

    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/autocomp...ocomplete.html
    Here is my js file:
    http://www.erecoverydev.com/autocomp....tokeninput.js
    Here is my php code:
    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.

  • #2
    Regular Coder
    Join Date
    Mar 2009
    Posts
    175
    Thanks
    3
    Thanked 1 Time in 1 Post
    Lol nm, forgot to change the table values in the js file.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •