Bonjour à tous,
voilà, je rencontre un problème avec 2 listes déroulantes dont les données sont issues d'une base de donnée ACCESS.
Cela fait 2 jours que je cherche mais je trouve pas de solution!!! J'espère que quelqu'un pourra m'aider...
Mon problème est le suivant :
j'affiche dans un 1er formulaire les données issues de la table DOWNLOAD plus précisement la colonne categorie_produit.
En fonction de ça, un 2ème formulaire s'affiche avec le contenu des nom_produit pour la categorie_produit sélectionnée.
Jusque là pas de problème, mais dès que je sélectionne une référence dans ce 2ème formulaire, celui-ci s'efface et réaffiche le 1er formulaire alors que je souhaiterai afficher d'autre valeur dans un tableau mais celui-ci ne s'affiche pas!
Le but étant de réduire la sélection afin d'afficher des informations avec lien pour téléchargementde fichier....
Vous trouverez ci-dessous le code de la page.
<!--#include file="_connexion2.asp"-->
<link href="../../style.css" rel="stylesheet">
<%fzone1=Request.Form("zone1")
fzone2=Request.Form("zone2")
%>
<table border=1 bordercolor="#FF0000" cellpadding="4" cellspacing="0" align="center" width="70%">
<tr><td style="font-family:Arial, Helvetica, sans-serif; font-size:24px" align="center">Les notices d'utilisations</td></tr></table>
<br><br><br><br><br>
<table border=0 align="center">
<tr>
<td>Sélectionner la catégorie de produit pour laquelle vous recherchez une notice d'utilisation.<br>
<form method="POST" name="download" action="TEST.asp">
<select name="zone1" size="1" onChange="javascript:download.submit()">
<%if fzone1<>"" then%><option><%=fzone1%></option>
<%else%><option value=''>Sélectionner</option><%end if
Requete = "Select DISTINCT categorie_produit from download"
set rsProd= Conn2.Execute(Requete)
if rsProd.eof=false then
rsProd.MoveFirst
do while not rsProd.eof
if rsProd("categorie_produit")<>fzone1 then%>
<option value='<%=rsProd("categorie_produit")%>'><%=rsProd("categorie_produit")%></option>
<%end if
rsProd.MoveNext
loop
end if%>
</select>
</form>
<%if not fzone1="" then
Requete = "Select * from download WHERE categorie_produit='"&fzone1&"'"
set rsProd2= Conn2.Execute(Requete)
if rsProd2("nom_produit")<>fzone1 then%>
<form method="POST" name="download2" action="TEST.asp">
<select name="zone2" size="1" onChange="javascript:download2.submit()">
<%if fzone2<>"" then%><option><%=fzone2%></option>
<%else%><option value=''>Sélectionner</option><%end if
if rsProd2.eof=false then
rsProd2.MoveFirst
do while not rsProd2.eof
if rsProd2("ref_produit")<>fzone2 then%>
<option value='<%=rsProd2("ref_produit")%>'><%=rsProd2("ref_produit")%></option>
<%end if
rsProd2.MoveNext
loop
end if%>
</select>
</form>
<%if fzone2<>"" then
Requete = "Select * from download WHERE categorie_produit='"&fzone1&"'"
set rsProd= Conn2.Execute(Requete)
if rsProd("nom_produit")<>fzone2 then%><br><br>
<table border="1" bordercolor="#FFFFFF" cellpadding="4" cellspacing="0" width="500">
<tr bgcolor="#CCCCCC"><td align="center"><b>Référence</b></td>
<td align="center"><b>Nom du produit</b></td>
<td align="center"><b>Lien de téléchargement</b></td></tr>
<%rsProd.moveFirst
do while not rsProd.eof%>
<tr>
<td align="center" style="border-bottom-color:#000000"><%=rsProd("ref_produit")%></td>
<td align="center" style="border-bottom-color:#000000"><%=rsProd("nom_produit")%></td>
<td align="center" style="border-bottom-color:#000000"><a href="fichiers/notices/<%=rsProd("nom_fichier1")%>">Manuel d'utilisation</a></td>
<%
rsProd.MoveNext
loop
end if%>
</tr></table>
</td></tr></table>
<%end if%>
<%end if%>
<%end if%>
<%
conn2.close
set conn2=nothing
%>
Merci pour votre aide.