Hi, I have a simple asp page which allows you to select something from one combo box, then that fills another one at the same time appending the selection in the url. This works fine in IE, but not Netscape. The files are located here
Can someone please have a quick glance over my code and tell me what I can do. In my SelectHomes.asp page i have the following code: (thanx in advance)
<!-- #include file = "ADOVBS.INC" -->
<HTML>
<%
strProvSelected=Request.QueryString("prov"
AccessConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" _
& server.mappath("Quiz2DB_b2000.mdb" & ";uid=;password=;"
Set dbConn = Server.CreateObject("ADODB.Connection"
dbConn.Open AccessConnectionString
%>
<SCRIPT LANGUAGE="JavaScript">
function changeCities(){
scriptProvince=document.chooseCity.select1.value;
document.all["chooseCity"].action="SelectHomes.asp?prov="+scriptProvince;
document.all["chooseCity"].submit();
}
function changeListings(){
scriptCity=document.chooseCity.select2.value;
document.all["chooseCity"].action="DisplayListings.asp";
document.all["chooseCity"].submit();
}
</SCRIPT>
<BODY bgColor="#fff8dc">
<h1>Find and Compare Homes</H1>
<FORM name="chooseCity" method="post" action="SelectHomes.asp">
<% if strProvSelected="Alberta" then%>
<SELECT name="select1" STYLE="WIDTH:220" onchange="changeCities(this)">
<OPTION VALUE="Alberta" selected>Alberta</OPTION>
<OPTION VALUE="British Columbia">British Columbia</OPTION>
</SELECT>
<%else
'when the pg is first loaded, the code below is displayed
'with BC as the default selection%>
<SELECT name="select1" STYLE="WIDTH:220" onchange="changeCities(this)">
<OPTION VALUE="Alberta" >Alberta</OPTION>
<OPTION VALUE="British Columbia" selected>British Columbia</OPTION>
</SELECT>
<%end if
Set rsCities = Server.CreateObject("ADODB.Recordset"
rsCities.Filter = "Province='" & strProvSelected & "'"
'if the above filter is used, it chooses everything in the city
'table where the Province is the one chosen
rsCities.Open "Select * from Cities", dbConn, adOpenStatic, adLockOptimistic, adCmdText
'then it selects all those records, and since there is > 1, it needs loop
optionCount=0
Response.write ("<Select name='select2' STYLE='WIDTH:220'>"
While not rsCities.EOF
Response.write("<Option Value='" & rsCities("Cities" & "'>" & rsCities("Cities" & "</Option><BR>"
rsCities.Movenext
Wend
Response.write ("</Select><br><br>"
%>
<input type="button" value="Submit" style="width:200" onclick="changeListings()">
</form>
</BODY>
</HTML>
Can someone please have a quick glance over my code and tell me what I can do. In my SelectHomes.asp page i have the following code: (thanx in advance)
<!-- #include file = "ADOVBS.INC" -->
<HTML>
<%
strProvSelected=Request.QueryString("prov"
AccessConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" _
& server.mappath("Quiz2DB_b2000.mdb" & ";uid=;password=;"
Set dbConn = Server.CreateObject("ADODB.Connection"
dbConn.Open AccessConnectionString
%>
<SCRIPT LANGUAGE="JavaScript">
function changeCities(){
scriptProvince=document.chooseCity.select1.value;
document.all["chooseCity"].action="SelectHomes.asp?prov="+scriptProvince;
document.all["chooseCity"].submit();
}
function changeListings(){
scriptCity=document.chooseCity.select2.value;
document.all["chooseCity"].action="DisplayListings.asp";
document.all["chooseCity"].submit();
}
</SCRIPT>
<BODY bgColor="#fff8dc">
<h1>Find and Compare Homes</H1>
<FORM name="chooseCity" method="post" action="SelectHomes.asp">
<% if strProvSelected="Alberta" then%>
<SELECT name="select1" STYLE="WIDTH:220" onchange="changeCities(this)">
<OPTION VALUE="Alberta" selected>Alberta</OPTION>
<OPTION VALUE="British Columbia">British Columbia</OPTION>
</SELECT>
<%else
'when the pg is first loaded, the code below is displayed
'with BC as the default selection%>
<SELECT name="select1" STYLE="WIDTH:220" onchange="changeCities(this)">
<OPTION VALUE="Alberta" >Alberta</OPTION>
<OPTION VALUE="British Columbia" selected>British Columbia</OPTION>
</SELECT>
<%end if
Set rsCities = Server.CreateObject("ADODB.Recordset"
rsCities.Filter = "Province='" & strProvSelected & "'"
'if the above filter is used, it chooses everything in the city
'table where the Province is the one chosen
rsCities.Open "Select * from Cities", dbConn, adOpenStatic, adLockOptimistic, adCmdText
'then it selects all those records, and since there is > 1, it needs loop
optionCount=0
Response.write ("<Select name='select2' STYLE='WIDTH:220'>"
While not rsCities.EOF
Response.write("<Option Value='" & rsCities("Cities" & "'>" & rsCities("Cities" & "</Option><BR>"
rsCities.Movenext
Wend
Response.write ("</Select><br><br>"
%>
<input type="button" value="Submit" style="width:200" onclick="changeListings()">
</form>
</BODY>
</HTML>