php - How to use tokenized autocomplete on multiple fields without conflicting -


i need run autocomplete script on multiple fields in form. created separate js , php files each field , seems pull values php file ok, when don't have match correctly displays no results, when have match suggestion box disappears in first field. last field works correctly.

i'm assuming there var conflict between script instances here , need find way around it.

i've tried playing around if else statements in both php file , js file try , use 1 can't work.

you can view script @ http://www.erecoverydev.com/autocomplete2/js/jquery.tokeninput.js

my php file is:

<? mysql_pconnect("localhost", "username", "password") or die("could not connect"); mysql_select_db("mydb") or die("could not select database"); $param = mysql_real_escape_string ($_get["q"]);  $query = sprintf("select cb_activities jos_comprofiler cb_activities regexp '^$param'"); $arr = array(); $rs = mysql_query($query);  while($obj = mysql_fetch_object($rs)) {     $arr[] = $obj; }  echo json_encode($arr); ?> 

there has simple way use multiple instances of this.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -