A small bug found:
// code ADDED : function which generate bar on right (ieme item/total item)
function actb_generate_bar(a) {
// generate bar if row > 1 and actb_lim >0
if (actb_self.actb_lim >0) {
var nbRows = a.rows.length;
if (nbRows > 1) {
// Construct bar on right of table
bar = a.rows[0].insertCell(-1);
bar.id="actb_bar";
bar.style.fontSize = actb_self.actb_fSize;
bar.style.backgroundColor = "#DDEEFF";
bar.style.color = "red";
bar.style.fontWeight = "bold";
bar.rowSpan=nbRows;
bar.style.verticalAlign= "bottom";
bar.height="100%";
this.actb_bar = bar;
actb_refresh_bar();
}
my question was if the variables that define if the input text box will be limited to given options defined already is specific to input text box or it is defined per instance of actb Object
10x ahead,
BTW, is it function quickly will huge collection of options?
I'm not sure if I get your question but i believe you were asking if the variables for each actb object is unique to each definition. Well the answer is yes.
<br />
obj = new actb(document.getElementById('textbox_id'),customarray);<br />
obj.actb_mouse = false; // no mouse support<br />
obj2 = new actb(document.getElementById('textbox2_id'),customarray2);<br />
obj2.actb_startcheck = 2; // start actb only after 2nd character<br />
As above shows, you can have different settings for different textboxes. The first will have no mouse support whereas the second will have (default setting).
as for your 2nd question... well yes, the speed is pretty reasonable even for huge collection of options (more than 1000). Although by then there will be a noticable decrease in speed, but it will pass undecided for average users
I have defined two textboxes with separate lists and options, but it doesn't seem to work.. Both textboxes share the list and options of the last defined textbox.
Has some functionality changed when settings were made global?
And YES, the textboxes have different id's, and the arrays and objects has different names too, as in the example.
Testet on both Mozilla and IE with same result.
I'm able to get it to worg with a array generated from my SQL server. It feeds the name of my members to a textbox, but I'd like to feed the key from the SQL server to a hidden text box, is this possible ?
Thanks
zichun,
I haven't gone thru the whole code, but i presume the string values are hard coded? Long back, we had an interesting scenario where auto complete had to be done for values from DB. We used web service calls from js to retrieve values from DB and do this. Anyhow, ur idea is cool....GOOD WORK...
Your component is really a gr8 thing!
Is it possible to set for every input text box individually if it should be limited to the options was given or opened for free text too?
I dont think this was mentioned, but yes you can have multiple text boxes with individual auto-complete. When you are defining the textbox and auto-complete array just add "new" before the function. Look below for an example:
var obj1 = new actb(document.getElementById('make'),arrMake);
var obj2 = new actb(document.getElementById('model'),arrModel);
var obj3 = new actb(document.getElementById('engine'),arrEngine);
my question was if the variables that define if the input text box will be limited to given options defined already is specific to input text box or it is defined per instance of actb Object
10x ahead,
BTW, is it function quickly will huge collection of options?
This is a simple thing, but is kind of neat. If you changed the mouse icon from a text (I-Beam) to a pointer. All you have to do is set the style.cursor = 'pointer' (see http://www.quirksmode.org/css/cursor.html for details).
Makes it more obvious when the user selects the entry with a mouse (also makes it a bit easier to select something).
If the autocomplete input is within a form, pressing enter will not only complete the text box, but will also submit the form. Is there any way to catch the enter keypress before it submits the form and cancel it?