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 ?
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...
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);
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.
I would be also interested in such a function, I'm using a Google Suggest style keyword refresh (every 300 ms it reads the entered textbox value and feeds the keywords to the object - I made the actb_generate() global but it seems that it doesn't catch it properly, probably because of response delay, so I'd like a function to generate the list without the onkeydown)
Last Visit: 16-Nov-19 21:52 Last Update: 16-Nov-19 21:52