// tablename : Map
// Fields list :ID,Country,Province
<%
Dim cont,conn,rs,I
cont = Request("country")
'// sub for list country name
Private Sub ListCountry()
set conn = Server.CreateObject("ADODB.Connection")
conn.Open strConn 'Connection string for your database
set rs = conn.Execute "SELECT DISTINCT(COUNTRY) FROM MAP"
Do while not Rs.EOF
Response.wite "<option value ='" & Rs("COUNTRY") & "'>" & Rs("COUNTRY") & "</option>" & vbCrLf
Rs.Movenext
Loop
Rs.close
Conn.close
set Rs = nothing
set conn = nothing
End Sub
'// sub for list all province that relate of conutry
Private Sub ListCountry()
set conn = Server.CreateObject("ADODB.Connection")
conn.Open strConn 'Connection string for your database
set rs = conn.Execute "SELECT PROVINCE FROM MAP WHERE COUNTRY = '" & cont & "'"
Do while not Rs.EOF
Response.wite "<option value ='" & Rs("PROVINCE") & "'>" & Rs("PROVINCE") & "</option>" & vbCrLf
Rs.Movenext
Loop
Rs.close
Conn.close
set Rs = nothing
set conn = nothing
End Sub
%>
<html><head><title>test</title></head>
<body>
<form name = 'frmTest' method = 'post' action = '#'>
<b>select your country</b><br>
<select name = 'country' onchange = 'document.forms[0].submit();'>
<option value = ''>--SELECT--</option>
<% Response.write ListCountry 'Call sub for list country name %>
</select><br>
<b>select your country</b><br>
<% If cont <> "" Then %>
<select name = 'province' onchange = 'document.forms[0].submit();'>
<option value = ''>--SELECT--</option>
<% Response.write ListProvince %>
</select>
<% Else %>
<select name = 'province' disabled>
<option value = ''>--SELECT--</option>
</select>
<% End If %>
</form>
</body>
</html>