Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 5th, 2003, 02:06 PM
Registered User
 
Join Date: Jul 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to tcasp
Default Two drop down dependent list boxes and a Button

I need little help or suggestion regarding displaying selected item and its information from second list box.

I can populate the first list box from database ,then on the basis of selected category from first I can populat the second one but when I select one item from second list box it displays all the items in that subcategoy ,I want to display only selected itemm and information about it from the database.

here is info
listbox 1 listbox 2 Name= Models
Name: Makes
tablename=Makes table Name =Models
cols Cols of tables
Makeid autonum Modelid autno unique value
Makes Honda Makeid it can has multiple values
        Ford Model

Here is code,I am skipping the first part of code

<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>

<%

makeid = Request.form("makeid")
model = Request.form("Model")
make = Request.form("make")
models = Request.Form("models")
makes = Request.Form("makes")
modelid = Request.Form("modelid")


Set objConn=server.createobject("adodb.connection")

objConn.open("Provider=Microsoft.Jet.OLEDB.4.0;D ata Source="&server.mappath("cars.mdb"))

Set rs=objConn.execute("SELECT Makes.make,Models.Model,Models.makeid,modelid " &_
    " FROM Makes,Models Where makes.makeId ="&models.makeid&" and models.makeid="&request("makes")&" "&_
     " and models.makeid="&Request("models")&" and models.modelid="&modelid&" ")
    
    
%>

<center> <table border="1" cellpadding="2" width="30%" height="10%">

     <tr><STRONG>This is for selected value from second list box</STRONG><U></U>
     </tr><br>
         <tr align=left>

                <th>Make</th>
                <th>Models</th>
                 <th>Make Id</th>


            </tr>
     <% Do while not Rs.EOF %>
     <tr>
                <td> <%=rs("Make") %></td>
                <td> <%=rs("Model") %></td>
                <td> <%=rs("MakeId") %></td>


            </tr>

             <% Rs.movenext
            loop

             Rs.Close
            Set Rs =nothing
             objconn.close
            Set objconn =nothing
     %>
                </table></center>
<P>&nbsp;</P>

</BODY>
</HTML>

and the errro:

Error Type:
Microsoft VBScript runtime (0x800A01A8)
Object required: 'Convertible'
/good/contents_ddropdown.asp, line 22


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)

Page:
POST 43 bytes to /good/contents_ddropdown.asp

POST Data:
makes=4&models=Convertible&btnsubmit=Submit

Any suggestion(s) will be greatly appreciated.

Thank you.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to retain form values from dependent list ? George B Javascript 0 September 15th, 2006 03:54 PM
dependent drop downs p2pMember ASP.NET 1.0 and 1.1 Professional 0 July 19th, 2006 05:25 AM
3 Drop Down box w/ db values & dependent choices smarks Classic ASP Databases 1 March 2nd, 2005 03:32 PM
Retain form value from dependent list box qhong Dreamweaver (all versions) 18 November 4th, 2004 03:36 AM
SQL , List Boxes/Menu Boxes, DB's Ginzu3 Classic ASP Databases 1 June 30th, 2003 04:07 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.