Ehmm scusami ho postato un codice Work in progress cmq calcola che al posto di prodottoid e prodottocat c'è
codice:
categoria=rs2("categoria")
categoriaid=rs2("categoriaid")
Quindi Verrebbe
codice:
<select name="categoriapre" class="menu">
<option>-- seleziona --</option>
<%
categoria=rs2("categoria")
categoriaid=rs2("categoriaid")
Set categele=Conn.Execute ("SELECT * FROM categoria WHERE sottocatv=0 order by data asc")
do while not categele.eof
response.write "<option value=""pippo"">- " & categele("categ") & "</option>"
sottocatele=categele("id")
Set sottocategele=Conn.Execute ("SELECT * FROM categoria WHERE sottocatv ='" & sottocatele & "' order by data asc")
Id=sottocategele("id")
sottocatv=sottocategele("sottocatv")
do while not sottocategele.eof = true
response.write "<option selected value=""" & sottocategele("sottocatv") & "|" & sottocategele("id") & """ "
if categoriaid=id and categoria=sottocatv then
response.write " selected"
end if
response.write " > " & sottocategele("sottocat") & "</option>"
sottocategele.movenext
loop
categele.movenext
loop
sottocategele.close
Set sottocategele=Nothing
categele.close
Set categele=Nothing
%>
</select>