Thanks ronpat/PaulOB. Yes, I thought that it was a JS thing also. Maybe I didn’t describe it very well the first time, which may be the reason Paul_Wilkins requested the thread to be moved. Anyhow, to answer your questions, ronpat:
It’ll be just one webpage and the text in the divs is for information purposes only; it does not ‘do’ anything, so using my example code, if a user wanted to see suggestions of various types of vegetables, they would search for ‘vegetables’ and just view the results.
One of the reasons I wish to have the bold effect, is that items in the drop down list are long sentences so when a user types something, they can quickly ‘see’ where in the long sentence the keyword is. Besides, I think the effect is kinda cool!
There are no tables or text files; the entire system is the example code in the fiddle posted.
The reason I have a multiple select is that I want users to be able to compare results and not have to click them one by one and having to try to remember previously clicked ones. So, for example, if ‘Vegatables from Africa’ and ‘Vegetables from Australia’ were in the drop down list and they ctrl and clicked both results, they would be able to see them both at the same time. Ideally, what I really wanted it to do was allowing results from separate searches to be compared, so for example, if ‘Fruits from Africa’ and ‘Fruits from Australia’ were also in the list, they could search for “veg” and click ‘Vegatables from Africa’, then search for “fru” and click ‘Fruits from Australia’ BUT be able to see/compare both at the same time, i.e. the new search would not remove the result of the original search. Each could then be removed by deselecting in the dropdown or clicking the Close (X) button on the div itself. I am not sure if this is even possible for a multiple select dropdown. I have looked into those dual transfer list box things also and they seem suitable for what I have described above, however, I am not sure if results can have multiple lines of text like I have in my divs.
The reason I am reluctant to change my JS is that I am not sure I would understand any wholesale changes. It has taken me months to get where I was when I posted my original thread, which to you experts, may seem like a few easy changes here and there! HAHAH. Paul_Wilkins has also very kindly cleaned it up and re-written it so nicely, that I would be reluctant messing too much with it, being not too literate on the subject.
Thanks very much for taking the time to provide this code and accompanying helpful explanations, m3g4p0p. At present, unfortunately, my knowledge is pretty much limited to modifying existing code. I do wish I could learn it, as I hate not understanding what things mean, however, at the moment, it’s a matter of days before I need to publish the system live. I am currently in the process of editing/tidying up all the text that will populate the drop down list; haven’t got round to setting it up in the code yet, however, will see what I can do with your code as soon as I can and post back.
Thanks.