Search Menu

liunx

Guest
Can anyone tell me the best way using only HTML, JavaScript and CSS, to create a search menu? I'm basically looking for a scrollable datasheet view that pulls up records when users enter data into various text boxes.

I'm not so much concerned right now with how to link it to any data, but moreso just the best way to get it on the webpage.Ok the issue with linking it to your data is directly related to how you will put it one your webpage. I'll do my best to explain how I would go about this after you answer these questions:
1) Is your data static? Can users update the data or upload their own data, or will it always be the same.
2) Do you want the records to auto-fill as the user starts typing, or do you want it to only search on submission. (an example would be if the user types the letter "a", all data objects not starting with "a" dissapear, so on and so forth)Thanks for the reply.

Currently the listbox will be used to open up a form that contains the record.
So, the listbox itself will only contain a few fields from the record. The opening of the record will come from an "Open Record" button.

I am limited to CSS, HTML, and JavaScript only, if this is at all possible.OK, so take your data and create an array containing a description of each item. It would also be wise to create a multidimensional array so you can store keywords that would pull this up in a search. If you know how to do this you're one step closer, and if not you'll need to post in the javascript forum for help on making arrays. After this step is done, you need to create a javascript function that will take the search query and run it through all of the items in the array using .indexOf() function to cross reference each item containing this keyword with the search query. After this function finds the result that is best suited to the query you need a javascript function utilizing the document object model (DOM) that will collect the descriptions of each item and place them in order of relevancy based on the query on the page. Each of these descriptions can be made as a hyperlink which will lead the user to the actual full record.
 
Back
Top