Getting info from Drop Down
- From: Emma <Emma@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 1 Aug 2008 12:38:30 -0700
I'm trying to use a drop down list for the user to select an entery which
will goo back to the database and grabs what the user selects then outputs a
list using ConnectDatabase.asp. The problem is I don't know how to make input
tags for a drop down? Hi I have a html file with the following:
<form name "input" action "ConnectDatabase.asp" method "get">
<select>BedroomSize
<optgroup label="Bedroom Size">
<option value = "Bachelor"> Bachelor </option>
<option value = "Room / Share"> Room / Share
</option>
<option value = "1"> 1</option>
<option value = "2"> 2 </option>
<option value = "3">3 </option>
<option value = "4"> 4 </option>
<option value = "5+"> 5+ </option>
</optgroup>
</select>
<input type="submit" value="Submit">
</form>
And I have an .asp file with the following
<%
Option Explicit
Response.Expires = -1000
Dim oConn
Dim oRS
Dim sSQL
Dim sColor
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &
Server.MapPath("\EmilyLeeParsons\db\HHCDataBase.mdb"))
sSQL = "SELECT DatePosted, Area, NearestIntersection, HousingType,
BedroomSize, Rent, Details FROM TblHousing"
Set oRS = oConn.Execute(sSQL)
Response.Write("<table border=1 cellpadding=1 cellspacing=1
style='font-family:arial; font-size:10pt;'>")
Response.Write("<tr bgcolor=black style='color:white;'><td>DatePosted</td>")
Response.Write("<td>Area</td>")
Response.Write("<td align=right>NearestIntersection</td>")
Response.Write("<td>HousingType</td>")
Response.Write("<td align=right>BedroomSize</td>")
Response.Write("<td align=right>Rent</td>")
Response.Write("<td>Details</td></tr>")
sColor = "white"
Do While NOT oRS.EOF
If sColor = "silver" Then
sColor = "white"
Else
sColor = "silver"
End If
Response.Write("<tr bgcolor='" & sColor & "'>")
Response.Write("<td>" & oRS("DatePosted").Value & "</td>")
Response.Write("<td>" & oRS("Area").Value & "</td>")
Response.Write("<td>" & oRS("NearestIntersection").Value & "</td>")
Response.Write("<td>" & oRS("HousingType").Value & "</td>")
Response.Write("<td>" & oRS("BedroomSize").Value & "</td>")
Response.Write("<td align=right>$" & oRS("Rent").Value & "</td>")
Response.Write("<td align=right>" & oRS("Details").Value & "</td></tr>")
oRS.MoveNext
Loop
Response.Write("</table><br><br>")
oConn.Close
Set oRS = Nothing
Set oConn = Nothing
%>
How do I get the information from the html page drop down to the asp page?
.
- Follow-Ups:
- RE: Getting info from Drop Down
- From: Old Pedant
- RE: Getting info from Drop Down
- Next by Date: RE: Getting info from Drop Down
- Next by thread: RE: Getting info from Drop Down
- Index(es):
Relevant Pages
|
Loading