ciao a tutti devo ricaricare la pagina quando selezionano una provincia così da visualizzare solo le città a lei associate. Ma il cliente si lamenta che quando seleziona la regione o provincia ricarica la pagina e non riesce a capire cosa deve fare nel frattempo. Qualcuno mi può dare un consiglio su come migliorare questa ricerca? Grazie a tutti
ps includo il codice del file
<%
if request("cambia")="si" then
regione = request("regione")
provincia = request("provincia")
comune = request("comune")
professione = request("professione")
end if
%>
<html>
<head>
<title>Ricerca professionisti</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../BIANCO.css" type="text/css">
<SCRIPT language=vbscript>
sub Apri(cambia)
regione = document.form1.regione.value
provincia = document.form1.provincia.value
IDCom = document.form1.comune.value
professione= document.form1.professione.value
if cambia="si" then
document.body.style.cursor = "wait"
document.location.href="default.asp?cambia=si®i one=" & regione & "&provincia=" & provincia & "&comune=" & IDCom & "&professione=" & professione
end if
end sub
</SCRIPT>
<style>
<!--
div.Section1
{page:Section1;}
body,td,th {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #333333;
}
a:link {
color: #333333;
}
a:visited {
color: #666666;
}
a:hover {
color: #999999;
}
body {
background-color: #FFFFFF;
}
-->
</style></head>
<%if request("ricerca")="nessuno" then%>
<body onload="javascript:alert('Nessun professionista è stato trovato con i criteri selezionati')">
<%else%>
<body>
<%end if%>
<table>
<tr>
<td colspan="17" height="68" align=center>
<table width=300 height=50 border=1><tr>
<td bgcolor=#95AAAE align=center><FONT face="Verdana, Arial, Helvetica, sans-serif" color=white size=4>Criteri di Ricerche</font>
</tr></table>
</td>
</tr>
<tr>
<td colspan="17" height="220" valign="top">
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD height=30>
<center>
<form name=form1 method=post action="XXXXXXX">
<table>
<TR>
<TD vAlign=top >Professione</TD>
<TD width="65%">
<select name=professione>
<option value="0">All</option>
<%
sqlCat="select distinct professione from Professionisti order by professione"
set rsCat=OBJdbConnection.Execute(sqlCat)
while not rsCat.eof
strSel=""
if professione = rsCat("professione") then strSel ="selected"
%>
<option <%=strSel%> value="<%=rsCat("professione")%>"><%=rsCat("profes sione")%></option>
<%
rsCat.movenext
wend
rsCat.close
%>
</select>
</TD></TR>
<tr>
<td>[b]Regione:</font></td>
<td>
<select name="regione" onchange="javascript:Apri('si')" >
<option value=0> - </option>
<%
sqlstring="select * from Regioni order by Descr_Regione"
set rsReg=OBJdbConnection.Execute(sqlstring)
while not rsReg.eof
if isnumeric(regione)= false then regione=0
if cint(regione) = cint(rsReg("ID_Regione")) then
%>
<option value=<%=rsReg("ID_Regione")%> selected><%=replace(rsReg("Descr_Regione"),chr(14) ,"'")%> </option>
<%
else
%>
<option value=<%=rsReg("ID_Regione")%>><%=replace(rsReg("D escr_Regione"),chr(14),"'")%> </option>
<%
end if
rsReg.movenext
wend
rsReg.close
%>
</select>
</td>
</tr>
<tr>
<td>[b]Provincia:</font></td>
<td>
<select name="provincia" onchange="javascript:Apri('si')" >
<option value=0> - </option>
<%
if isnumeric(regione)= false then regione=0
if regione > 0 then
sqlstring="select * from Province where ID_Regione=" & cint(regione) & " order by Descr_Provincia"
else
sqlstring="select * from Province order by Descr_Provincia"
end if
set rsProv=OBJdbConnection.Execute(sqlstring)
while not rsProv.eof
if isnumeric(provincia)= false then provincia=0
if cint(provincia) = cint(rsProv("ID_Provincia")) then
%>
<option value=<%=rsProv("ID_Provincia")%> selected><%=replace(rsProv("Descr_Provincia"),chr( 14),"'")%> </option>
<%
else
%>
<option value=<%=rsProv("ID_Provincia")%>><%=replace(rsPro v("Descr_Provincia"),chr(14),"'")%> </option>
<%
end if
rsProv.movenext
wend
rsProv.close
%>
</select>
</td>
</tr>
<tr>
<td>Comune:</td>
<td>
<select name="comune">
<option value=0> - </option>
<%
if cint(provincia) > 0 then
sqlstrComuni="select comuni.ID_Comune as ID_Comune,Comuni.Descr_Comune as Descr_Comune,Comuni.Cap_Comune as Cap_Comune,Regioni.ID_Regione as ID_Regione" &_
" from Comuni,Regioni,Province" &_
" where Comuni.ID_Provincia=Province.ID_Provincia " &_
" and Province.ID_Regione=Regioni.ID_Regione " &_
" and Comuni.ID_Provincia=" & provincia & " order by Descr_Comune"
else
sqlstrComuni="select comuni.ID_Comune as ID_Comune,Comuni.Descr_Comune as Descr_Comune,Comuni.Cap_Comune as Cap_Comune,Regioni.ID_Regione as ID_Regione" &_
" from Comuni,Regioni,Province" &_
" where Comuni.ID_Provincia=Province.ID_Provincia " &_
" and Province.ID_Regione=Regioni.ID_Regione " &_
" order by Descr_Comune"
end if
set rsComuni=OBJdbConnection.Execute(sqlstrComuni)
while not rsComuni.eof
if isnumeric(comune)= false then comune=0
if cint(comune) = cint(rsComuni("ID_Comune")) then
%>
<option value=<%=rsComuni("ID_Comune")%> selected><%=replace(rsComuni("Descr_Comune"),chr(1 4),"'")%></option>
<%
else
%>
<option value=<%=rsComuni("ID_Comune")%>><%=replace(rsComu ni("Descr_Comune"),chr(14),"'")%></option>
<%
end if
rsComuni.movenext
wend
rsComuni.close
%>
</select>
</td>
</tr>
<tr>
<td colspan=2 align=center>
<Input type=submit value="Esegui Ricerca"></td>
</tr>
</table>
</form>
</center>
</TD></TR></TBODY></TABLE>
</td>
</tr>
</table>
</body>
</html>