metto il codice che è meglio forse si capisce di più
codice:
<%
codicefiscale=Request.querystring("codicefiscale")
cognome=Request.querystring("cognome")
nome=Request.querystring("nome")
data_nascita=Request.querystring("data_nascita")
pnas=request.querystring("pnas")
citta_nascita=Request.querystring("citta_nascita")
indirizzo=Request.querystring("indirizzo")
pres=request.querystring("pres")
citta_residenza=Request.querystring("citta_residenza")
telefono=Request.querystring("telefono")
cellulare=Request.querystring("cellulare")
professione=Request.querystring("professione")
email=Request.querystring("email")
Set pn = Server.CreateObject("ADODB.Recordset")
SQL3 = "SELECT DISTINCT provincia FROM comuni"
set pn=Conn.Execute(SQL3)
Set pr = Server.CreateObject("ADODB.Recordset")
SQL1 = "SELECT DISTINCT provincia FROM comuni"
set pr=Conn.Execute(SQL1)
Set cn = Server.CreateObject("ADODB.Recordset")
SQL2 = "SELECT comune FROM comuni where provincia='"&pnas&"'"
set cn=Conn.Execute(SQL2)
Set cr = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT comune FROM comuni where provincia='"&pres&"'"
set cr=Conn.Execute(SQL)
%>
<script language="JavaScript"><!--
function focus(){document.form.codicefiscale.focus();}
function MM_jumpMenu(targ,selObj,restore){ file://v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
function Form1_Validator(theForm)
{
if (theForm.nome.value == "")
{ alert("Prego, inserisci il Nome.");
theForm.nome.focus(); return (false);
}
if (theForm.cognome.value == "")
{ alert("Prego, inserisci il Cognome");
theForm.cognome.focus(); return (false);
}
if (theForm.codicefiscale.value == "")
{ alert("Prego, inserisci il codice fiscale.");
theForm.codicefiscale.focus(); return (false);
}
if (theForm.data_nascita.value == "")
{ alert("Prego, inserisci la data di nascita");
theForm.data_nascita.focus(); return (false);
}
if (theForm.prov_nascita.value == "")
{ alert("Prego, inserisci la provincia di nascita");
theForm.prov_nascita.focus(); return (false);
}
if (theForm.citta_nascita.value == "")
{ alert("Prego, inserisci la città di nascita");
theForm.citta_nascita.focus(); return (false);
}
if (theForm.indirizzo.value == "")
{ alert("Prego, inserisci l'indirizzo");
theForm.indirizzo.focus(); return (false);
}
if (theForm.prov_residenza.value == "")
{ alert("Prego, inserisci la provincia di residenza");
theForm.prov_residenza.focus(); return (false);
}
if (theForm.citta_residenza.value == "")
{ alert("Prego, inserisci la città di residenza");
theForm.citta_residenza.focus(); return (false);
}
return (true);
}
function ale()
{
alert("Utente già presente");
}
// --></script>
<body onload="focus();<% if request("Id")="1" then%>ale();<%end if%>">
<form method="post" action="add-process.asp" onsubmit="return Form1_Validator(this)" name="form">
<table border="0" valign="top" cellPadding="0" cellspacing="0" width="672" style="border-collapse: collapse">
<tr>
<td width="100%" valign="top">
<table border="0" cellpadding="0" cellspacing="2" width="723">
<tr>
<td colspan="6" align="center" class="titolonero">
I campi contrassegnati con <font color="#FF0000">*</font> sono OBBLIGATORI</td>
</tr>
<tr>
<td colspan="6" class="testo0"></td>
</tr>
<tr>
<td width="144" class="testo0">Codice Fiscale <font color="#FF0000">*</font></td>
<td width="170"><input type="text" name="codicefiscale" size="24"></td>
</tr>
<tr>
<td width="144" class="testo0">Cognome <font color="#FF0000">*</font></td>
<td width="170"><input type="text" name="cognome" maxlength="20" size="20" value="<%=cognome%>"></td>
<td width="78" class="testo0">Nome <font color="#FF0000">*</font></td>
<td width="321"><input name="nome" type="text" maxlength="20" size="20" value="<%=nome%>"></td>
</tr>
<tr><td colspan="6" class="titoletto">Dati di nascita</td></tr>
<tr>
<td width="144" class="testo0">Data di Nascita<font color="#FF0000"> *</font></td>
<td width="170"><input name="data_nascita" maxlength="20" size="20" value="<%=data_nascita%>"></td>
</tr>
<tr>
<td width="144" class="testo0">Provincia <font color="#FF0000">*</font></td>
<td width="170">
<select name="prov_nascita" size="1" onChange="MM_jumpMenu('parent',this,0);return Form1_restore(this)" class="Stile14">
<%if pnas="" then%>
<option value="">-----------------</option>
<%else%>
<option value="<%=pnas%>"><%=pnas%></option>
<%end if%>
<%Do While Not pn.EOF%>
<option value="add.asp?pnas=<%=pn("provincia")%>&pres=<%=pres%>"><%=pn("provincia")%></option>
<%pn.MoveNext
Loop%>
</select></td>
<td width="78" class="testo0">Città <font color="#FF0000">*</font></td>
<td width="321">
<select name="citta_nascita" size="1" class="Stile14">
<option value="">-----------------</option>
<%Do While Not cn.EOF%>
<option value="<%=cn("comune")%>"><%=cn("comune")%></option>
<%cn.MoveNext
Loop%>
</select></td>
</tr>
<tr><td colspan="6" class="titoletto">Dati di Residenza</td></tr>
<tr>
<td width="144" class="testo0">Indirizzo<font color="#FF0000">*</font></td>
<td width="170"><input type="text" name="indirizzo" size="20" value="<%=indirizzo%>"></td>
</tr>
<tr>
<td width="144" class="testo0">Provincia<font color="#FF0000"> *</font></td>
<td width="170">
<select name="prov_residenza" size="1" onChange="MM_jumpMenu('parent',this,0)" class="Stile14">
<%if pres="" then%>
<option value="">-----------------</option>
<%else%>
<option value="<%=pres%>"><%=pres%></option>
<%end if%>
<%Do While Not pr.EOF%>
<option value="add.asp?pres=<%=pr("provincia")%>&pnas=<%=pnas%>"><%=pr("provincia")%></option>
<%pr.MoveNext
Loop%>
</select></td>
<td width="78" class="testo0">Città <font color="#FF0000">*</font></td>
<td width="321">
<select name="citta_residenza" size="1" class="Stile14">
<option value="">-----------------</option>
<%Do While Not cr.EOF%>
<option value="<%=cr("comune")%>"><%=cr("comune")%></option>
<%cr.MoveNext
Loop%>
</select></td>
</tr>
<tr><td colspan="6" class="titoletto">Altro</td></tr>
<tr>
<td width="144" class="testo0">Telefono</td>
<td width="170"><input type="text" name="telefono" size="20" value="<%=telefono%>"></td>
<td width="78" class="testo0">Cellulare</td>
<td width="321"><input type="text" name="cellulare" size="18" value="<%=cellulare%>"></td>
</tr>
<tr>
<td width="144" class="testo0">Professione</td>
<td width="170"><input type="text" name="professione" size="20" value="<%=professione%>"></td>
<td width="78" class="testo0">E-mail</td>
<td width="321"><input type="text" name="mail" size="20" value="<%=email%>"></td>
</tr>
<tr>
<td height="88" width="144" valign="top"><input type="submit" name="Submit" value="Accetto">
</td>
<td height="88" colspan="3" valign="top"></table>
</td>
</tr>
</table>
</form>
appena sclego la provincia in automatico mi ricarica la pagina ripulendo i campi compilati