Syntax Help
Hi,
I have two small (I hope) related problems. I'm using ASP with vbscript (can't get out of that). If I coul duse javascript I'd be fine, but I'm a little inexperienced with vbscript, so any help gratefully received.
I'm building a form based on the contents of a database. I have a drop down menu (<select><option> etc.) I have a database, and each entry has (just for example) a name and a place. The drop down is populated by running through the database and adding an option for each entry. The idea is that the user can select a place that's in the database, and submit the form, getting the names back.
Here's the problem:
1)
If I have say, 'Arncott' as a place, no problem, because there's one entry. But if I have 'London' there's loads, and I end up with lots of identical options in my form. I have no idea how to use arrays in vbscript. Would the best way of doing it to be to run through the database, check if the place was already in the array and if not add it? If so how do I do that?
2)
I'd like to alphabetise it. I guess that's an array thing too. How would I go about that?
Thanks for any help/advice/tips/tutorials you know about.
|