hello there.. i currently use this method to preload airport names into my drop down..
then i use..
i would like to expand on this.
i would like a new set of values (from a different table in my database) to be loaded into my drop down when my user clicks a radio button.
here is the page at the moment.. it loads the values correctly and the radio buttons are ready..
http://www.londonheathrowcars.com/new.asp
if i wanted to load the field hotelNAME from the table tblHotel into the drop down when the hotel radio is clicked.. how would i do it?
ive tried using some pure javascript and holding the values in an array but i would rather pre load them from my database..
here is the page code
Code:
<%
set myconn = Server.CreateObject("ADODB.connection")
connection = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &_
Server.MapPath("/_db_import/prices.mdb") & ";"
myconn.open (connection)
set rs=Server.CreateObject("ADODB.recordset")
rs.Open "Select airportNAME from tblAIRPORT", myconn
%>
then i use..
Code:
<%
if not rs.eof then
do until rs.eof
%>
<option class="grey" value="<%=rs("airportNAME")%>"><%=rs("airportNAME")%></option>
<%
rs.movenext
loop
end if
%>
i would like to expand on this.
i would like a new set of values (from a different table in my database) to be loaded into my drop down when my user clicks a radio button.
here is the page at the moment.. it loads the values correctly and the radio buttons are ready..
http://www.londonheathrowcars.com/new.asp
if i wanted to load the field hotelNAME from the table tblHotel into the drop down when the hotel radio is clicked.. how would i do it?
ive tried using some pure javascript and holding the values in an array but i would rather pre load them from my database..
here is the page code
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>
<%
set myconn = Server.CreateObject("ADODB.connection")
connection = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" &_
Server.MapPath("/_db_import/prices.mdb") & ";"
myconn.open (connection)
set rs=Server.CreateObject("ADODB.recordset")
rs.Open "Select airportNAME from tblAIRPORT", myconn
%>
<BODY>
<form>
<p>
<input type="radio" name="chooseList" value="C1"> Airports<br>
<input type="radio" name="chooseList" value="C2"> Hotels<br>
<input type="radio" name="chooseList" value="C3"> Seaports<br>
<input type="radio" name="chooseList" value="C4"> Misc
</p>
<p><select class="droppy" name="postcode">
<option value="">...</option>
<%
if not rs.eof then
do until rs.eof
%>
<option class="grey" value="<%=rs("airportNAME")%>"><%=rs("airportNAME")%></option>
<%
rs.movenext
loop
end if
%>
</select></p>
</form>
</BODY>
</HTML>