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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drop Down Menus

Status
Not open for further replies.

mdr227

Programmer
Nov 17, 2000
114
0
0
US
Does any have a good product or samples of javascript that work well with dynamically generated drop down menus (where the menus are generated from db table entries) using ASP? Thanks.
 
I'm doing this using VB Script. Note the working example below.

Setup connection. This is using a DSN to connect.
<%
myDSN=&quot;DSN=CentralStation&quot;
mySQL=&quot;select TeamLeader.Supervisor from TeamLeader order by TeamLeader.ID&quot;

' displays a database field as a listbox
set conntemp=server.createobject(&quot;adodb.connection&quot;)
conntemp.open myDSN
set rstemp=conntemp.execute(mySQL)
if rstemp.eof then
response.write &quot;no data for<br>&quot;
response.write mySQL
conntemp.close
set conntemp=nothing
response.end
end if
%>


Here is the select which is populated from the connection code above. Just select the table and the fields you want to use to populate the drop down.


<Select name=&quot;TeamLeader&quot;>
<%
' Now lets grab all the data
do until rstemp.eof %>
<option> <%=RStemp(0)%> </option>
<%
rstemp.movenext
loop

rstemp.close
set rstemp=nothing
conntemp.close
set conntemp=nothing
%>
</Select>


Don't sweat the small stuff.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top