Salut,
le langage utilisé est de l'asp vbscript.
Dans ma page, je voudrais que lorsque je choisi une référence de produit dans ma liste déroulante, tout le produit s'affiche dans un tableau en dessous. Lorsque je choisi une autre référence, le produit s'affiche en dessous du précédent et ainsi de suite.
Voici mon code déféctueux, merci de m'aider à le faire fonctionner :
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Document sans titre</title>
</head>
<body
<%Set conn = Server.CreateObject("ADODB.Connection")
MdbFilePath = Server.MapPath("Commande.mdb")
str = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & MdbFilePath & ";"
conn.Open str
set Res=conn.execute("Select * from Consommable")
%>
<form action="" name="Reference" id="Reference" method="post">
<div align="center">Choisir une reference :
<select name="Ref" size="1">
<option selected value="*">Sélectionnez ...
<%while not Res.eof %>
<option value="<%=Res("RefConso")%>"><%=Res("DesignConso")%>
<%
Res.movenext
wend
Res.close
%>
</select>
<input type="submit" name="OK" value="OK">
</div>
</form>
<table border="1" cellpadding="0" cellspacing="0" width="300">
<tr>
<%
Refer = Request("Ref")
Set Conn = Server.CreateObject("ADODB.Connection")
MdbFilePath = Server.MapPath("Commande.mdb")
str = "DRIVER=Microsoft Access Driver (*.mdb);DBQ=" & MdbFilePath & ";"
Conn.Open str
sql = "Select * from Consommable where RefConso=" & Refer
Set Res = Conn.execute(sql)
%>
<%Do while not Res.eof%>
<tr>
<td><%=Res("RefConso")%></td>
<td><%=Res("DesignConso")%></td>
<td><%=Res("MarqueConso")%></td>
<td><%=Res("ConstructeurConso")%></td>
<td><%=Res("RefRegionaleConso")%></td>
<td><%=Res("PrixUnitaireConso")%></td>
</tr>
<%Res.movenext
Loop
Res.Close
Set Res = nothing
Conn.Close
Set Conn = nothing
%>
</tr>
</table>
</body>
</html>