G
Guy Hocking
Hi there,
I am having a few problems compiling a list box that is conditional on what
is selected in another list box.
What i need is a List box (lstArea) that displays one thing when the List
Box (lstRegion) is selected East or West. Basically the areas will change
when East or West is selected in lstRegion.
The data comes from an SQL Server view, and my current non-working code is
as follows, my syntax in the SQL statement is completly wrong, i have no
idea how to go about this..
The View has 2 columns, vchrLong_Desc and vchrArea_Name, i want the new list
box (lstArea) to display vchrArea_Name when the List Box lstRegion displays
vchrLong_Desc.
************************
<select name="lstArea" size="1"><br>
<option value="">Please Select </option>
<%
Dim SQL, RS,
SQL = "SELECT * from vw_SOLS_RegionsAreas_u WHERE
vw_SOLS_RegionsAreas_u.vchrLong_Desc =" ("lstRegion")""
set RS = DataConnection.Execute(SQL)
If not RS.EOF then
while not RS.EOF
Response.write("<option
value='"&RS("vchrArea_Name")&"'>"&RS("vchrArea_Name")&"</option>")
RS.movenext()
wend
else
Response.write("")
end if
%>
</select>
***************************
Hope that is not too confusing,
I am new to ASP so you will have to forgive me for being nieve
Thanks in advance
Guy
I am having a few problems compiling a list box that is conditional on what
is selected in another list box.
What i need is a List box (lstArea) that displays one thing when the List
Box (lstRegion) is selected East or West. Basically the areas will change
when East or West is selected in lstRegion.
The data comes from an SQL Server view, and my current non-working code is
as follows, my syntax in the SQL statement is completly wrong, i have no
idea how to go about this..
The View has 2 columns, vchrLong_Desc and vchrArea_Name, i want the new list
box (lstArea) to display vchrArea_Name when the List Box lstRegion displays
vchrLong_Desc.
************************
<select name="lstArea" size="1"><br>
<option value="">Please Select </option>
<%
Dim SQL, RS,
SQL = "SELECT * from vw_SOLS_RegionsAreas_u WHERE
vw_SOLS_RegionsAreas_u.vchrLong_Desc =" ("lstRegion")""
set RS = DataConnection.Execute(SQL)
If not RS.EOF then
while not RS.EOF
Response.write("<option
value='"&RS("vchrArea_Name")&"'>"&RS("vchrArea_Name")&"</option>")
RS.movenext()
wend
else
Response.write("")
end if
%>
</select>
***************************
Hope that is not too confusing,
I am new to ASP so you will have to forgive me for being nieve
Thanks in advance
Guy