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[1] = "http://twitter.com/mytwitter";
links[2] = "http://www.facebook.com/myfacebook";
links[3] = "http://www.mysite.com/ad";
links[4] = "http://www.mysite.com/ads";
links[5] = "http://www.mysite.com/index.cfm/community/";
links[6] = "http://www.mysite.com/index.cfm/community/places/";
links[7] = "http://www.mysite.com/index.cfm/community/people/";
links[8] = "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:
function BindDataToVarSearch()
{
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_lim =5;
this.actb_timeOut = -1;
this.actb_firstText =true;
this.actb_hStyle = 'text-decoration:underline;font-weight="bold"';
document.getElementById('txtVarSearch').value="";
document.getElementById('txtVarSearch').select();
This works fine for me in FF 3.5.6, and I haven't changed anything. So, if you're having problems, then it may be changes you've made or your version of FF.
This is the best autocomplete.. i have used with dynamic data from database in more than 5 of my websites.. works like a charm for even more than 20000 records..
If someone is willing to help me with my problem..
My customarray has values with croatian letters (čćžšđ).
For example, there is a an element 'Varaždin' in the array.
Array contains all the places in Croatia, over 7000 elements.
Users often type in 'Varazdin' so I want the script to be able to compare the 'safe' version ('Varazdin') of the users input text and the 'safe' version of the elements in my array.
There are a lot of elements with croatian letters so if I put Varazdin (and many others) in array, the array would very big and it would slow down my page speed.
I have a function to replace the chars:
function conv_chars_to_safe(word){
var fromCroatian = Array('ć','Ć','č','Č','š','Š','ž','Ž','đ','Đ','DŽ','dž');
var toSafe = Array('c','C','c','C','s','S','z','Z','dj','DJ','DZ','dz');
varfrom, to, i;
for(i = 0; i < 10; i++){
from = new RegExp(fromCroatian[i], 'g');
to = toSafe[i];
word = word.replace(from, to);
}
return word;
}
I'm not relly sure where the comparison in the code is.
this is one great neat code from u zichun!
If you, or anyone else who read this dont mind, I'm kinda wondering if there is a way to show the array content to different textfield (with different id of course) once we press the enter button to input our choice.
Thanks for this article as it worked perfectly in my application..I am using this script in my asp.net(C#) application.I am passing textbox values from my aspx.cs page using function.But when the length of the string values exceeds 700 script is not working..Plz help me..
My code..
(In aspx.cs Page)
Page.ClientScript.RegisterStartupScript(this.GetType(), "PassArray", st.ToString(), true);
where PassArray is the javasript function and st is a
StringBuilder which contains the values
(Javascript function)
function PassArray(incomingArray)
{
try
{
for (var i = 0; i < incomingArray.length; i++)
document.writeln(incomingArray[i]);
//ss=incomingArray;
var obj = actb(document.getElementById('<%=txtCity.ClientID %>'),incomingArray);
return incomingArray;
}
catch(e)
{alert(e)}
}
I am using ajax to update the list used by actb. When listToShow is populated for the first time,
everything works fine. However, when I get a new listToShow from the database using ajax, and
send it to setupFullSiteList again, the mouse click for autocomplete stops working.
Any idea why ?
function setupFullSiteList(listToShow){
var myActb = new actb(document.getElementById("location"), listToShow, true, 1, "location");
}
hi zi chun,
im a coder in html and php and we re starting a website for a comparison of companys... i dont know if we earn money with that site or not but i prefer to ask u in the way: can i use that script u wrote on a commercial website? (because is licened under cc).. or what du u want?
pls give me an answer cause i need it in the next coming days...
Anyone have any ideas on how to set the width for the dropdown to be fixed to my selection box? Also, I'd like to add a border to the dropdown list box, rather than color it. I'm relatively new to JavaScript and while I can do this on a normal div, I'm not there yet if I need to do it via script.
After
function actb_generate(){
if (document.getElementById('tat_table')){ actb_display = false;document.body.removeChild(document.getElementById('tat_table')); }
if (actb_kwcount == 0){
actb_display = false;
return;
}
a = document.createElement('table');
a.cellSpacing='1px';
you can add what you need - example - a.style.width='150px';
Last Visit: 31-Dec-99 18:00 Last Update: 26-Sep-24 18:36