Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > asp and dropdown list with database

Reply
Thread Tools

asp and dropdown list with database

 
 
news
Guest
Posts: n/a
 
      05-03-2005
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


 
Reply With Quote
 
 
 
 
Ray Costanzo [MVP]
Guest
Posts: n/a
 
      05-03-2005
<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" <(E-Mail Removed)> wrote in message
news:OE8Rdo$(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database Database Database Database scott93727@gmail.com Computer Information 0 09-27-2012 02:43 AM
DataBase DataBase DataBase DataBase scott93727@gmail.com Computer Information 0 09-26-2012 09:40 AM
1 Gridview. Dropdown A is column from database, Dropdown B is column from database, Data in A and B must be from same row. anonymoushamster@gmail.com ASP .Net 2 11-07-2007 12:40 PM
How to populate dropdown list from database? =?Utf-8?B?TWVyZGFhZA==?= ASP .Net 3 10-20-2004 06:15 PM
dropdown list and database connection djharrison ASP General 1 09-25-2003 06:55 AM



Advertisments