[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.8

How automatically filter products on a page based on dropdown selection?

Asked by tingleweb in Active Server Pages (ASP)

Tags: ado, box, filter, select

I have added a select box to the top of a working page - the working page shows Products which belong to a Department passed via. URL

The select box I have added - shows printers in the dropdown which belong to the Department Name.
What I would like to do now is filter the products based on the selected item in the drop down.

I have a table called [1digiPrinter] - which displays the PrinterID, Manufacturer and PrinterName
and
a table called [1digiPrinterProduct] which has PrinterID and ProductID so that they can be mapped.

So in essence the filter needs to say - show me all Products where the ProductID = [1digiPrinterProduct].ProductID and PrinterID = [1digiPrinterProduct].PrinterID (although I know at this stage, I'm not passing the PrinterID out of the select, only the PrinterName

Basically - how would I filter the products like this but more importantly - how can I action this filter everytime someone selects a different printer?  (Resubmit to same page - ideally automatically without having to click the submit button)

Note - there are two seperate forms on this page.  The other form does a comparison of 2 or more products.

If you need any more info - give me a shout.

I hope you can help.

Thanks in advance!

__________________________________________________________________________________________
<%
 
If PrinterName = "" Then

  Dim MyConn, RS, connStr
 
 
  Response.Write "Selection = <b>" & PrinterName & "</b><br>"
 
  Set MyConn=Server.CreateObject("ADODB.Connection")
  connStr=""

  SQL = "Select Distinct PrinterName From [1digiPrinter] Where Manufacturer = '"&rs1digiDepartment("DepartmentName")&"'"
  MyConn.Open connStr
  Set RS = MyConn.Execute(SQL)
%>




   
        
  <p>

  <form method = "Post">
    <select name="PrinterName">


      <option selected>--Select PrinterName--

      <%While Not RS.EOF%>

      <option value="<%=RS("PrinterName")%>">

      <%=RS.Fields("PrinterName")%>

      <%
    RS.MoveNext
  Wend

  RS.Close
  MyConn.Close
  Set RS = Nothing
  Set MyConn = Nothing
 
 
%>

    </select>

<input type="submit" name="save" value="Show me Ink Cartridges for this printer">
  </p>
  <p>
 
    <input type="hidden" name="PrinterName" size="20" value="<%=PrinterName%>">
  </p>
  </form>


<%End If%>


      <!--  Display the description -->
      &nbsp;&nbsp;<img src="/images/compare.gif" alt="Click two or more checked boxes and then click on Compare at the bottom to compare products" width="200" height="95">
      <%

'  Create an ADO database connection
set db1digiProduct = server.createobject("adodb.connection")

'  Create the record set
set rs1digiProduct = server.CreateObject("adodb.recordset")

'  Open the connection using our ODBC file DSN
db1digiProduct.open ""

'  Build the sql statement to retrieve the products in
'  the department.  The ID of the department is passed in.
sql = "execute [1digi_RetrieveDeptProducts] " & request("DepartmentID")

'  Execute the SQL statement and retrieve the record set
set rs1digiProduct = db1digiProduct.Execute(sql)

'  We are going to rotate the images from left
'  to right.
%>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
      <form action="compare.asp" method="post" target="_blank">
        <table width="100%" height="129" border="0">
          <tr>
            <%
Flag=0

'  Loop through the products record set
do until rs1digiProduct.EOF

'  Retrieve the product information to be displayed.
ProductName = rs1digiProduct("ProductName")
ProductImage = rs1digiProduct("ProductImage")
ProductID = rs1digiProduct("ProductID")
ProductPriceexcvat = rs1digiProduct("ProductPriceexcvat")
ProductPriceIncVAT = rs1digiProduct("ProductPriceIncVAT")


'  rotate the
'  product images from left to right.


if Flag = 1 Then

Flag=1
%>
            <!-- Build the link to the product information.  -->
         
            </tr><tr>
            <td width="100%" height="110" align="left" valign="top">
              <div align="left">
                <p align="left"> <strong><%=ProductName%></strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><%=formatcurrency(ProductPriceExcVAT)%>ex. VAT&nbsp;&nbsp;<%=formatcurrency(ProductPriceIncVAT)%> inc. VAT</strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </p>
                <p align="center"><a href="product.asp?ProductID=<%=ProductID%>">
                  </a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="product.asp?ProductID=<%=ProductID%>"><img src="images/products/<%=ProductImage%>" border="0" align="middle"></a>&nbsp;
                  <a href="additem.asp?ProductID=<%=ProductID%>&Quantity=1&ProductName=<%=ProductName%>&Productpriceincvat=<%=ProductPriceincvat%>&ProductShipping1stClass=<%=rs1digiProduct("ProductShipping1stClass")%>&ProductShipping2ndClass=<%=rs1digiProduct("ProductShipping2ndClass")%>&ProductShipping1stClassR=<%=rs1digiProduct("ProductShipping1stClassR")%>&ProductShippingSD=<%=rs1digiProduct("ProductShippingSD")%>"><img src="/images/addtobasket.gif" alt="Add to basket" width="100" height="24" border="0" align="right"></a>
                </p>
                <a href="product.asp?ProductID=<%=ProductID%>"></a>
                  &nbsp;&nbsp;&nbsp;&nbsp; <input type="checkbox" name="ProductID" value="<%=ProductID%>">
                Compare <hr></div>
              </td>
          <% else %>
          <!-- Build the link to the product information.  -->
            <td width="100%" height="110" align="left" valign="top">
              <div align="left">
                <p align="left"> <strong><%=ProductName%></strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong><%=formatcurrency(ProductPriceExcVAT)%>ex. VAT&nbsp;&nbsp;<%=formatcurrency(ProductPriceIncVAT)%> inc. VAT</strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                </p>
                <p align="center"><a href="product.asp?ProductID=<%=ProductID%>">
                  </a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="product.asp?ProductID=<%=ProductID%>"><img src="images/products/<%=ProductImage%>" border="0" align="middle"></a>&nbsp;
                  <a href="additem.asp?ProductID=<%=ProductID%>&Quantity=1&ProductName=<%=ProductName%>&Productpriceincvat=<%=ProductPriceincvat%>&ProductShipping1stClass=<%=rs1digiProduct("ProductShipping1stClass")%>&ProductShipping2ndClass=<%=rs1digiProduct("ProductShipping2ndClass")%>&ProductShipping1stClassR=<%=rs1digiProduct("ProductShipping1stClassR")%>&ProductShippingSD=<%=rs1digiProduct("ProductShippingSD")%>"><img src="/images/addtobasket.gif" alt="Add to basket" width="100" height="24" border="0" align="right"></a>
                </p>
                <a href="product.asp?ProductID=<%=ProductID%>"></a>
                  &nbsp;&nbsp;&nbsp;&nbsp; <input type="checkbox" name="ProductID" value="<%=ProductID%>">
                Compare
                <hr>
              </div>
              </td>
          <%

Flag=Flag+1




end if

'  Move to the next row
rs1digiProduct.movenext

loop

%>
         
        </tr></table>
        <p>
         
        </p><input type="submit" value="Compare">
      </form>
      <a href="product.asp?ProductID=<%=ProductID%>">
        </a>

___________________________________________________________________________________________
[+][-]05/21/03 09:53 AM, ID: 8558181Expert 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.

 
[+][-]05/21/03 10:10 AM, ID: 8558305Author 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.

 
[+][-]05/21/03 10:23 AM, ID: 8558384Author 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.

 
[+][-]05/21/03 12:32 PM, ID: 8559254Assisted 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.

 
[+][-]05/21/03 01:53 PM, ID: 8559784Expert 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.

 
[+][-]05/21/03 08:57 PM, ID: 8561860Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Active Server Pages (ASP)
Tags: ado, box, filter, select
Sign Up Now!
Solution Provided By: gladxml
Participating Experts: 4
Solution Grade: A
 
[+][-]05/22/03 01:45 AM, ID: 8562949Author 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.

 
[+][-]05/22/03 01:58 AM, ID: 8562994Expert 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.

 
[+][-]05/22/03 02:59 AM, ID: 8563223Author 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.

 
[+][-]05/22/03 03:16 AM, ID: 8563286Expert 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.

 
[+][-]05/22/03 03:33 AM, ID: 8563345Expert 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.

 
[+][-]05/22/03 03:47 AM, ID: 8563409Author 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.

 
[+][-]05/22/03 04:01 AM, ID: 8563488Author 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.

 
[+][-]05/22/03 09:36 AM, ID: 8565870Author 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.

 
[+][-]05/22/03 12:36 PM, ID: 8567038Assisted 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.

 
[+][-]05/22/03 03:12 PM, ID: 8567894Author 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.

 
 
Loading Advertisement...
20091111-EE-VQP-89