leiaah 0 Report post Posted November 11, 2005 Hey guys. I'm doing a web-based (running on an intranet) Inventory System for my final requirement in school. I'm looking for a code to autocomplete a form like if I type in a few letters in a textfield, the rest of the word gets displayed already or if I type in a few letters of an item in a drop-down menu (Select), the focus goes to that item. Has anyone done this before or does anyone have the code for this? Thanks very much Share this post Link to post Share on other sites
Plenoptic 0 Report post Posted November 11, 2005 It does it by itself. I did a bit of research, and with a bit of editting I cam up with this code. It will do it for you. Just type in the first letter of the name and it will automatically highlight it. This particular dropdownbox is for a navigation. <FORM><SELECT NAME="blah"><OPTION VALUE="">Choose a Destination...<OPTION VALUE="/url/" >Guide to HTML<OPTION VALUE="/url/" >Idocs Home Page<OPTION VALUE="http://forums.xisto.com/; >Trap 17</SELECT><INPUT TYPE=SUBMIT VALUE="Go"></FORM> Share this post Link to post Share on other sites
Tyssen 0 Report post Posted November 11, 2005 Dropdowns will behave just like folders in Windows Explorer - type in some letters and it'll take you to it. Text inputs would be an entirely different story. You might be able to do it using javascript but I can see it being difficult to code especially when you have to consider that each browser is already going to have its own store of words previously typed into form elements which might clash with what the javascript is trying to output. Share this post Link to post Share on other sites
magiccode9 0 Report post Posted November 11, 2005 hi, i'am not family with this tech. but i do a search of ms web site and found this url that may help you. AutoComlete HTMl forms- hope this help. Share this post Link to post Share on other sites
leiaah 0 Report post Posted November 16, 2005 Thanks guys for your suggestions. Tyssen...The textfield is the most tricky because I would have to make use of data from a database so it's very likely that I'd be having difficulty if I just use javascript and I already plan on coding with PHP. I agree with what you said, Windows IE does have its own autocomplete functions in forms but I don't want the textfield to include words that are not present in my database. I hope what I'm saying is not all gibberish to you. Share this post Link to post Share on other sites
Tyssen 0 Report post Posted November 17, 2005 I'm not aware of any way that you can access information from your database without the form being submitted to the server, so in other words, you're not going to get any 'real time' interaction as the person is typing. Remember, that only javascript can be used for client-side interaction which is what you're talking about here. Everything else has to be submitted to the server first.You might be able to access your db and get it to print out an array of suitable words into a javascript function which is then tied to your text inputs, but it seems like it'd be a lot of work for a fairly small return.The other possibility is that you might be able to accomplish what you want with AJAX but I don't know enough about it. Share this post Link to post Share on other sites
sharpz 0 Report post Posted November 17, 2005 the only way to do this would be through javascript. an example is google suggest (https://www.google.com/webhp?complete=1&gws_rd=ssl) . they use a very complicated algorithim to decide what the suggest text will be though. is that what you were talking about? Share this post Link to post Share on other sites
leiaah 0 Report post Posted November 21, 2005 I think I found a program. My friend told me about MX Widgets, an add-on (sort of) for Dreamweaver MX. I googled it and I'm planning to download the trial version soon (now actually) since I'm already using Dreamweaver.From the Widgets website MX Widgets offers a powerful alternative to the regular HTML controls for Dreamweaver developers. Unlike standard HTML forms, our product relies on the power of the server side language and JavaScript to enforce an accurate and user friendly form completion: combo-boxes, date pickers, masked inputs, calendar controls and others. I think this is what I need:It allows the users type text in a dynamic drop-down menu and locates records based on the user's entered text. The field has an auto-complete feature, which fills in the first found matching entry. In order to select a record, the user can also use the down arrow key, or expand the menu Share this post Link to post Share on other sites