Ciao a tutti.
In un form ho una select dinamica che attinge dati da alcune tabelle di un db access.
Prima della select però ho alcuni capi di input.
Il problema è che quando faccio la prima select, con onchange mi va in refresh la pagina e perdo i dati dei campi di input.
Ho cercato ne forum ma ci sono solo esempi con un campo di input mentre io ne ho 4 prima della select.
Il codice è questo e grazie per l'aiuto:
idNazione = request.queryString("idNazione")
if isNumeric(idNazione) then
idNazione = cLng(idNazione)
else
idNazione = 0
end if
<form method="POST" action="/public/registration/activation_request_company.asp" onsubmit="return checkCheckBox(this)">
<%dim url_DB
url_DB=TrovaDB("0","30")
dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open url_DB
sql = "SELECT * FROM Nazione ORDER BY nazione"
set rs = conn.execute(sql)%>
<label for="email">Your Email:</label>
<input type="text" title="Your Email" name="email1" size="50" maxlength="50">
</p>
<label for="email">Your Email (verify):</label>
<input type="text" title="Your Email (verify)" name="email2" size="50" maxlength="50" >
</p>
<label for="nome">Your First Name:</label>
<input type="text" title="Your First Name" name="nome" size="30" maxlength="30">
</p>
<label for="cognome">Your Last Name:</label>
<input type="text" title="Your Last Name" name="cognome" size="30" maxlength="30">
</p>
<%if not rs.eof then%>
<label for="Country">Your Country:</label>
<select name="Nazione" onchange="document.location.href='<%=questaPagina% >?idNazione='+this.value;" title="Your Country">
<option value="">Select</option>
<%do until rs.eof%>
<option value="<%=rs("idNazione")%>"<% if idNazione = rs("idNazione") then %> selected="selected"<% end if %>><%=rs("nazione")%></option>
<%rs.moveNext
loop%>
</select>
</p>
<%end if
rs.close
set rs = nothing%>
</p>
....
....
....