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?
I have tried this with testarea on IE 6, Firefox 1.0.4, Mozilla 1.7 and Netscape 8 and it works fine. So you just need to pass on the id od the textarea instaed of text box.
On Netscape 6, there seems to be problem with textarea although basic functionality is working fine for text boxes (except for some javascript errors).