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!

Populating Drop_Down Box from INCLUDE FILE, NOT DB 1

Status
Not open for further replies.

KingElvis

Programmer
Jan 28, 2004
39
0
0
IL
I have an include file with the following variables:

name1 = "Tom"
name2 = "Dick"
name3 = "Harry"
etc....

I now want a drop down box to include these names as options. Can't seem to get the syntax right for the Drop-Down box.
 
use an array

Code:
dim names(2)
name(0) = "Tom"
name(1) = "Dick"
name(2) = "Harry"

with response
	  	.write "Names: "
		.write "<select name='name'>" & vbCrLf
	for i = 0 to Ubound(names) 
	  	.write "<option value='" & names(i) & "'" 
if names(i) = strName then
		.write " selected='selected'"
end if
		.write ">" 
		.write names(i)
		.write "</option>" & vbCrLf
	next
		.write "</select>" & vbCrLf
end with




Chris.

Indifference will be the downfall of mankind, but who cares?
A website that proves the cobblers kids adage.
Nightclub counting systems

So long, and thanks for all the fish.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top