Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

creating an auto fill index

Status
Not open for further replies.

kelli

Technical User
Jan 29, 2002
10
0
0
US
Has anyone had any experience creating an autofill index? We want to have autofill (like Excel) ability in a search text box. It can be set per user.

For example, if I consistently search my intranet for "Shipping", I would like it to automatically fill in for me as soon as I type "Sh". Another user on another machine might search for other things, so their index could be different. We have less than 10 users, so I'm not talking about doing this for a huge corporation - and each user can be identified by log-in name and password.

Thanks for any direction on where to start with this project.

Kelli
 
You can find the Javascript for it (the client side of the project) over on the Javascript forum, forum216, as they've answered the question a number of times.

For the ASP side of it (the server side of the project), it's as simple as saving the user's previous submissions in a database, where the terms are associated with their login. Those terms will be used to populate the Javascript.

Optionally, you could do the whole thing client side, by keeping their terms in their cookies, if users were always associated with the same browser. If so then the forum216 folks should be able to show you how to do everything.
 
I like the idea of saving submissions to the database because a user could get their own index at any machine they might log into. My question here is (and excuse my limited knowledge) how is the text box populated without hitting the server every time a new letter is typed in? Do you download everything in a user index to an array when the page opens, then use javascript to compare?

And if the user enters something that does not matcch the array ... that term then gets saved to the database and is available the next time the user opens that page?

One other question ... how are the terms saved in the database? Do you use one field and every new term is a different record?
 
Yes, you'd do one initial grab from the server and use JavaScript to read it as the person types.

As for the saving to the database, you'd need to set up a check that sees if the submitted word already exists for the current user, and if not, have an insert bit of code to add it.

As for the structure of the table, you'd probably want to have something similiar to this...
uniqueID, userID, searchWord (of course, rename to fit your situation).
 
okay, i'm beginning to get the picture.
thanks for all of the help! i may post again when i get into the details of it all, but at least i understand the process now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top