469,282 Members | 1,743 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

asp and dropdown list with database

Hello,

I need help with the following problem:

An HTML page that have two dropdown list whit different values:

1. Dropdown list 1(tblname1) =values with different location's. After user
has selected one value from the dropdown it should show values from
(tblname2) in the dropdown list2.

2. When user select an value from dropdown list2(tblname2) and click on a
button "GO" it should show all the value's from the database that been
selected in dropdown list1 and 2.

Please someone please help me out with this problem!?

Regards,

Kenneth
Jul 22 '05 #1
1 2290
<select
onchange="location.href='<%=Request.ServerVariable s("SCRIPT_NAME")%>?id='+th
is.value;">
<% '' your code that puts in options %>
</select>

<%

iSelectedID = Request.Querystring("id")
If Not iSelectedID = "" Then
''your code to get other values for second box
sSQL = "SELECT stuff FROM table2 WHERE foreignkey=" & iSelectedID
End If
%>
<select>
<% 'your code that loops through that second recordset if it was populated
%>

For more detailed examples, see here:
http://www.aspfaq.com/show.asp?id=2270

Ray at work
"news" <ne**@sitebiz.se> wrote in message
news:OE**************@tk2msftngp13.phx.gbl...
Hello,

I need help with the following problem:

An HTML page that have two dropdown list whit different values:

1. Dropdown list 1(tblname1) =values with different location's. After user
has selected one value from the dropdown it should show values from
(tblname2) in the dropdown list2.

2. When user select an value from dropdown list2(tblname2) and click on a
button "GO" it should show all the value's from the database that been
selected in dropdown list1 and 2.

Please someone please help me out with this problem!?

Regards,

Kenneth

Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by San Smith | last post: by
2 posts views Thread by Mike Collins | last post: by
5 posts views Thread by jung_h_park | last post: by
11 posts views Thread by eureka | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.