Liste deroulante qui fais qui change po

cs_artagnan Messages postés 20 Date d'inscription samedi 23 octobre 2004 Statut Membre Dernière intervention 15 mai 2011 - 24 nov. 2004 à 20:18
cs_roro06 Messages postés 732 Date d'inscription jeudi 2 janvier 2003 Statut Membre Dernière intervention 29 octobre 2007 - 3 déc. 2004 à 14:45
salut a tous

jai ce probleme qui vien du drop liste
en principe au chargement li dans la base de donne les type de categorie et quand je selectionne la categorie la fonction onchange devrais recharge la feuille avec les infos quelle a pris dans la base de donne et les affiche a laide dune boucle

en principe ma variable VALEUR devrais etre egale au request("choix")
sauf quelle affiche rien qqun vois qq chose!!!!!!!!

<!--#include file="library2.inc"-->

<html>
<head>
<title>Document sans titre</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<%
session("strTYPEP")="2"

%>

<form id="PieceInformatique" action="PieceInformatique.asp" method="post">
<table width="800" height="474" border="1" cellpadding="0" cellspacing="0">
----,

<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"800\" height=\"80\">

</object>

</td>

----

<table width="154" border="1" align="left" cellpadding="0" cellspacing="0">
----,

</td>
<select id="cboCategorie" onChange="location.href='PieceInformatique.asp?choix='+document.PieceInformatique.cboCategorie.SelectedValue" >

<%

dim objrsAfficherCategorie,lolo
lolo= request("Type")

if request("Type")= "2" then

set objrsAfficherCategorie = Server.CreateObject("ADODB.Recordset")
infoP = "SELECT tblCategorie_Informatique.Categorie_Informatique FROM tblCategorie_Informatique;"
objrsAfficherCategorie.Open infoP, objConn, 2, 3, 1
do While not objrsAfficherCategorie.eof

Response.write "<OPTION>" & objrsAfficherCategorie("Categorie_Informatique") & "</OPTION>"
objrsAfficherCategorie.MoveNext
loop
end if
%>
<%response.Write(valeur)%>
</select>



</td>
</tr>
<tr>
<td height="109" bgcolor="#FF9900">


<%
dim objrsAfficherProduits,valeur
valeur=request("choix")
response.Write("valeur")

response.Write(valeur)

set objrsAfficherProduits = Server.CreateObject("ADODB.Recordset")infoP "SELECT tblProduit_Informatique.CodeUPC, tblProduit_Informatique.NomImage, tblProduit_Informatique.MarqueDeCommerce, tblProduit_Informatique.Model, tblProduit_Informatique.DetailArticle, tblProduit_Informatique.PrixClient, tblProduit_Informatique.QTEStock FROM tblTypeProduit INNER JOIN (tblCategorie_Informatique INNER JOIN tblProduit_Informatique ON tblCategorie_Informatique.ID_Categorie_Informatique tblProduit_Informatique.ID_Categorie_Informatique) ON tblTypeProduit.ID_Type_Produit = tblProduit_Informatique.ID_Type_Produit WHERE(tblCategorie_Informatique.Categorie_Informatique)='" & valeur &"';"
objrsAfficherProduits.Open infoP, objConn, 2, 3, 1

do While not objrsAfficherProduits.eof%>

----, \"></td>
<%Response.write \"" & objrsAfficherProduits("CodeUPC") & ""
Response.write ", \" & objrsAfficherProduits(\"MarqueDeCommerce\") & \"\"
Response.write \"" & objrsAfficherProduits("Model") & ""
Response.write ", \" & objrsAfficherProduits(\"DetailArticle\") & \"\"
Response.write \"" & objrsAfficherProduits("PrixClient") & ""
Response.write ", \" & objrsAfficherProduits(\"QTEStock\") & \"\"
objrsAfficherProduits.MoveNext

loop

response.Write(\"valeur\")
%>

</td>


</td>
</tr>
<tr><td height="109">

</td>
</tr>
<tr>
<td>

Copyright@Microsecur
2004,
,
Webmaster
Steve Da Pratto


</td>
</tr>
</table>

</td>
</tr>
</table>
</form>

</html>

1 réponse

cs_roro06 Messages postés 732 Date d'inscription jeudi 2 janvier 2003 Statut Membre Dernière intervention 29 octobre 2007
3 déc. 2004 à 14:45
Mouais ! Bien peu de javascript dans cette page ... De plus j'ai eu de grosses difficultés à comprendre ta question.
Si j'ai bien compris : tu veux que ta page se recharge à partir de l'élément selectionné dans la liste déroulante ?
Il manque une value= à chacune de tes <option>: c'est elle qui est transférée.
Mets plutot : onchange="location.href='pieceInformatique.asp?choix=" + this.value"

Roro webDev 8-)
0
Rejoignez-nous