<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Dim rs_marca
Dim rs_marca_numRows
Set rs_marca = Server.CreateObject("ADODB.Recordset")
rs_marca.ActiveConnection = MM_conn_marca_modello_STRING
rs_marca.Source = "SELECT * FROM MARCA ORDER BY MARCA ASC"
rs_marca.CursorType = 0
rs_marca.CursorLocation = 2
rs_marca.LockType = 1
rs_marca.Open()
rs_marca_numRows = 0
%>
<%
Dim rs_modello__MMColParam
rs_modello__MMColParam = "1"
If (Request.Form("sel_marca") <> "") Then
rs_modello__MMColParam = Request.Form("sel_marca")
End If
%>
<%
Dim rs_modello
Dim rs_modello_numRows
Set rs_modello = Server.CreateObject("ADODB.Recordset")
rs_modello.ActiveConnection = MM_conn_marca_modello_STRING
rs_modello.Source = "SELECT * FROM MODELLO WHERE MARCA = " + Replace(rs_modello__MMColParam, "'", "''") + " ORDER BY MODELLO ASC"
rs_modello.CursorType = 0
rs_modello.CursorLocation = 2
rs_modello.LockType = 1
rs_modello.Open()
rs_modello_numRows = 0
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>AUTOWEB</title>
</head>
<body>
<form name="form1" id="form1" method="post" action="txt/motore.asp">
</p>
</p>
</p>
<table width="200" border="1">
<tr>
<td>Per </td>
<td><select name="sel_marca" id="sel_marca" onchange="this.form.submit()">
<option value="value" <%If (Not isNull((rs_modello.Fields.Item("MARCA").Value))) Then If ("value" = CStr((rs_modello.Fields.Item("MARCA").Value))) Then Response.Write("SELECTED") : Response.Write("")%>>Marca</option>
<%
While (NOT rs_marca.EOF)
%>
<option value="<%=(rs_marca.Fields.Item("ID").Value)%>" <%If (Not isNull((rs_modello.Fields.Item("MARCA").Value))) Then If (CStr(rs_marca.Fields.Item("ID").Value) = CStr((rs_modello.Fields.Item("MARCA").Value))) Then Response.Write("SELECTED") : Response.Write("")%> ><%=(rs_marca.Fields.Item("MARCA").Value)%></option>
<%
rs_marca.MoveNext()
Wend
If (rs_marca.CursorType > 0) Then
rs_marca.MoveFirst
Else
rs_marca.Requery
End If
%>
</select></td>
</tr>
<tr>
<td></td>
<td><select name="sel_modello" id="sel_modello">
<option value="value">Modello</option>
<%
While (NOT rs_modello.EOF)
%>
<option value="<%=(rs_modello.Fields.Item("ID").Value)%>"> <%=(rs_modello.Fields.Item("MODELLO").Value)%></option>
<%
rs_modello.MoveNext()
Wend
If (rs_modello.CursorType > 0) Then
rs_modello.MoveFirst
Else
rs_modello.Requery
End If
%>
</select></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="Submit" value="Invia" /></td>
</tr>
</table>
</p>
</form>
</body>
</html>
<%
rs_marca.Close()
Set rs_marca = Nothing
%>
<%
rs_modello.Close()
Set rs_modello = Nothing
%>

Rispondi quotando