renix
09-14-2004, 08:53 AM
Hi to all
My GREAT problem is:
I have a db with 2 field: cap and sede
I populate my combo menu with cap data.
My target is: when user select an choice to dropdown menu, He must view, above, all data referred to his selection.
My code complete is:
<!--#include file="Connections/cap.asp" -->
<%
Dim rs_cap
Dim rs_cap_numRows
Set rs_cap = Server.CreateObject("ADODB.Recordset")
rs_cap.ActiveConnection = MM_cap_STRING
rs_cap.Source = "SELECT * FROM cap "
rs_cap.CursorType = 0
rs_cap.CursorLocation = 2
rs_cap.LockType = 1
rs_cap.Open()
rs_cap_numRows = 0
%>
<html>
<head>
<title>Documento senza titolo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
Scegli il CAP:
<form method="post" action="cerca.asp">
<select name="scelta" id="scelta">
<!-- il while mostra tutti i campi dei cap presenti -->
<%
While (NOT rs_cap.EOF)
%>
<option value="<%=(rs_cap.Fields.Item("sede").Value)%>"><%=rs_cap.Fields.Item("cap").Value%> </option>
<%
rs_cap.MoveNext()
Wend
If (rs_cap.CursorType > 0) Then
rs_cap.MoveFirst
Else
rs_cap.Requery
End If
%>
</select>
<input type="submit" value="Invia">
</form>
<%
dim scelta
scelta=Request.Form("scelta")
If scelta <> "" Then
Response.Write(scelta)
End If
%>
</body>
</html>
<%
rs_cap.Close()
Set rs_cap = Nothing
%>
It work well but I can see only ONE field.... BUT I have more field for any choice.....
How can I work???
Thanks
My GREAT problem is:
I have a db with 2 field: cap and sede
I populate my combo menu with cap data.
My target is: when user select an choice to dropdown menu, He must view, above, all data referred to his selection.
My code complete is:
<!--#include file="Connections/cap.asp" -->
<%
Dim rs_cap
Dim rs_cap_numRows
Set rs_cap = Server.CreateObject("ADODB.Recordset")
rs_cap.ActiveConnection = MM_cap_STRING
rs_cap.Source = "SELECT * FROM cap "
rs_cap.CursorType = 0
rs_cap.CursorLocation = 2
rs_cap.LockType = 1
rs_cap.Open()
rs_cap_numRows = 0
%>
<html>
<head>
<title>Documento senza titolo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
Scegli il CAP:
<form method="post" action="cerca.asp">
<select name="scelta" id="scelta">
<!-- il while mostra tutti i campi dei cap presenti -->
<%
While (NOT rs_cap.EOF)
%>
<option value="<%=(rs_cap.Fields.Item("sede").Value)%>"><%=rs_cap.Fields.Item("cap").Value%> </option>
<%
rs_cap.MoveNext()
Wend
If (rs_cap.CursorType > 0) Then
rs_cap.MoveFirst
Else
rs_cap.Requery
End If
%>
</select>
<input type="submit" value="Invia">
</form>
<%
dim scelta
scelta=Request.Form("scelta")
If scelta <> "" Then
Response.Write(scelta)
End If
%>
</body>
</html>
<%
rs_cap.Close()
Set rs_cap = Nothing
%>
It work well but I can see only ONE field.... BUT I have more field for any choice.....
How can I work???
Thanks