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="DSN=CentralStation"
mySQL="select TeamLeader.Supervisor from TeamLeader order by TeamLeader.ID"
' displays a database field as a listbox
set conntemp=server.createobject("adodb.connection"
conntemp.open myDSN
set rstemp=conntemp.execute(mySQL)
if rstemp.eof then
response.write "no data for<br>"
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="TeamLeader">
<%
' 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>
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.