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> </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.
|