[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.4

Dynamic List boxes

Asked by Kevin_S in Active Server Pages (ASP)

Tags: drop, list

Hi all ASP newbie here:

First - I know this has been answered a billion times on this site and I've read some of the posts but unfortunitely my current working knowledge of ASP classic is limited as I've just moved over from client/server to web development so some of the posts I have been trying to interpret on this subject are so complex its not making sense to me so I thought I would start my own post and hope someone is willing to help out.  

Basically, I want to create an example that I can learn from and adapt for future uses.  I want to be able to select an item in one list box and have that then update/change the list of available items in the second list box.  for this simple example I have created 2 tables in sql server with the following properties:

table: test_productmain
PK: ProductID
field: ProductName

table: test_productsub
PK: ProDetailID
FK: ProductID
field: ProDetailName

these two tables are joined 1-many on ProductID...  Simple enough.  Now I have created a select box that queries the table: test_productmain, loops the recordset and populated the drop down fields.  Here is the code I am using:

CODE.................
<html>
<head>
</head>
<body>
<form name="testlist" method="post" action="testlist.asp">
<select name="selectmain">
<%
connstr = "DRIVER=SQL Server;SERVER=Jerry;DATABASE=Jerrydatabase;UID=xxxxxxx;PASSWORD=xxxxxxxxxxx"
sql = "Select ProductID, ProductName From dbo.test_productmain"
set conn = Server.CreateObject("ADODB.Connection")
conn.Open connstr
set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql,conn, 3
do until rs.eof
for j = 1 to rs.fields.count - 1
%>
<option value="<%= rs.fields("ProductID").value %>"><%= rs.fields("ProductName").value %></option>
<%
next
rs.movenext
loop
rs.close
conn.close
set rs = nothing
set conn = nothing
%>
</select>
</form>

</body>
</html>
CODE END...................................

This works great and populates the main list/select box.  My question is then, based on what I have above - what are the next steps to create another listbox which will be able to retrieve the ProductID value from the main listbox and use that as part of the Where clause in the SQL...?  I'm making this work 500 points as I am really appreciative to anyone who can set the rest of this up for me as I'm at a loss. Also - my javascript is even worse then my vbscript - note: this solution needs to me in vbscript for asp classic as this is not a .net app! and any javascript may need a little hand holding :)

If this were client/server I could crank this out in 3 seconds!!! so frustrated :)

Appreciate all help!
Kev
[+][-]10/20/04 10:42 PM, ID: 12366764Accepted Solution

Your question has an Asker Certified™ answer! Kevin_S verified that this solution worked for them--which means it will likely work for you, too. Click to view the solution free for 30-days now.

About this solution

Zone: Active Server Pages (ASP)
Tags: drop, list
Sign Up Now!
Solution Provided By: larellnielsen
Participating Experts: 2
Solution Grade: A
 
[+][-]10/20/04 07:36 AM, ID: 12358690Assisted Solution

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 30-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]10/20/04 07:37 AM, ID: 12358716Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/21/04 06:15 AM, ID: 12369455Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/21/04 06:17 AM, ID: 12369474Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/21/04 06:21 AM, ID: 12369531Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/26/04 06:34 AM, ID: 12410572Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]10/26/04 06:38 AM, ID: 12410615Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]10/27/04 06:20 AM, ID: 12421652Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20100315-EE-VQP-143