I downloaded your Auto-complete code sample from "http://www.codeproject.com/script/Articles/ArticleVersion.aspx?aid=8020&av=41368" to implement an on-line translator. I would like to know how to implement auto-complete control with external js file?
One suggested given for this code is to create a new instance of actb(). If you want to modify the array after it has been saved, be sure to capture the returned object:
var customarray_description = new Array();
var obj_description_school = new actb(document.getElementById('school'), customarray_description);
var customarray_code = new Array();
var obj_code_school = new actb(document.getElementById('school'), customarray_code);
obj_description_school.actb_keywords = a_different_customarray_description;
Changing the color hides the dropdown highlighting, but what I am seeking is something different.
If my list was populated with "Item1", "Item2", "Item3", and I type in "Item" then press [Enter], the script Automatically auto-completes the text in the textbox to become "Item1", as "Item1" gets highlighted BY Default (AS it is the first entry in the list).
I would like to perform a search for "Item". So I would like to type in "Item" then [Enter], without automatically selecting the first highlighted item in the list, in this case "Item1" gets selected and the action is performed.
Pretty much, how can I Modify the script SUCH that NO items are selected by default. I think this would solve my issue.
Set connString = Server.CreateObject("ADODB.Connection")
set objRS = Server.CreateObject("ADODB.Recordset")
mySQL = "SELECT * FROM Companies"set objRs = connString.Execute(mySQL)
If NOT objRs.EOF OR NOT objRs.BOF Then
GetPDFsArray = objRs.GetRows()
GetPDFsArray = ""EndIfEndFunction'Get array
arrPDFs = GetPDFsArray
IfisArray(arrPDFs) Thenfor i=0 to uBound(arrPDFs,2)
As I said the page loads, but the autocomplete does nothing.
Thanks in advance to anyboby that takes the time to read this.
hello, I have been using this great code for a while now. Recently however, I stumbled into one little problem related to this autocomplete control. Up until now, the control only allow more than one keywords for search if the words are typed consecutively. for example if we type "apple bee" the result will only show "apple bee cat", "apple bee dog", etc.
is there any possible way to let the control also show "apple frog bee".
thanks for any help
I am using the actb.js file to do an auto complete on some form files. In one file I provide an Array of file names (Foo.jpg, bar.jpg, foobar.jpg, etc). That works great.
In my second files I am auto completing a URL that will serve as a link for my image from the first field. My Array looks like this: var links = new Array(); links = "http://twitter.com/mytwitter"; links = "http://www.facebook.com/myfacebook"; links = "http://www.mysite.com/ad"; links = "http://www.mysite.com/ads"; links = "http://www.mysite.com/index.cfm/community/"; links = "http://www.mysite.com/index.cfm/community/places/"; links = "http://www.mysite.com/index.cfm/community/people/"; links = "http://www.mysite.com/index.cfm/onlineshopping/store/";
When I try to filter I am getting the following error: n.search is not a function actb_parse()actb.js (line 127) actb_generate()actb.js (line 203) actb_tocomplete()actb.js (line 537) (?)()actb.js (line 455) [Break on this error] var p = n.search(re);
Based on what I see it looks like the slashes in the URLs are tripping up the RegEx() calls. Is there something simple I can do to use this list without changing the core JS code? Like escape the slashes or something?
Its not working on my firefox 3.x . Dont even give any js error , works fine in IE. When I type in the search box nothing happens. I guess is the key event not firing? Any help will be greatly appreciated. Implemented as follows:
var obj = actb(document.getElementById('txtVarSearch'),variableList);
//KIA add the follwing event listener with your desired method what you want to call on a search list item is clicked
this.actb_cur_obj_clicked.prototype.itemClicked = setVariableFromSearchClick;
this.actb_fSize = '12px';
this.actb_bgColor = '#888888';
this.actb_textColor = '#FFFFFF';
this.actb_hColor = '#000000';
this.actb_fFamily = 'Verdana';
this.actb_timeOut = -1;
this.actb_hStyle = 'text-decoration:underline;font-weight="bold"';