Asp onchange

cs_artagnan Messages postés 20 Date d'inscription samedi 23 octobre 2004 Statut Membre Dernière intervention 15 mai 2011 - 24 nov. 2004 à 18:13
cs_artagnan Messages postés 20 Date d'inscription samedi 23 octobre 2004 Statut Membre Dernière intervention 15 mai 2011 - 24 nov. 2004 à 21:12
salut a toute ca fais 2jrs que je guosse sur ce code

a chake onchange dans la liste deroulante elle dois recharge
lapage avec les nouveaux infos dynamiquement

quelqun vois lerreur????

<form name="frmPIECEINFORMATIQUE"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 name="cboCategorie" onChange="location.href='PieceInformatique.asp?choix='+document.formulaire.liste.selectedIndex'">

<%

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%>

----

<%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")
%>

8 réponses

jesusonline Messages postés 6814 Date d'inscription dimanche 15 décembre 2002 Statut Membre Dernière intervention 13 octobre 2010 29
24 nov. 2004 à 18:54
moi je verrais au moins une erreur la dessus :

onChange="location.href='PieceInformatique.asp?choix='+document.formulaire.liste.selectedIndex'">

tu as dans "location.href='PieceInformatique.asp?choix='+document.formulaire.liste.selectedIndex'" un ' de trop ca devrait etre :
"location.href='PieceInformatique.asp?choix='+document.formulaire.liste.selectedIndex"

et puis tu es sur que le +document.f... est pris en compte par Jasvascript ? pas sur ... et sinon Document.formulaire.liste n'existe pas sur ce que tu nous as montré, t'es sur qu'il existe ? ce serait pas plutot
document.frmPIECEINFORMATIQUE.cboCategorie.SelectedValue

et puis pendant que j'y suis name n'est plus un attribut valide, il est encore utilisé pour les vieux navigateurs, utilise de preference id, et c'est d'ailleur le seul autorisé dans XHTML 1.0

Je pense que l'erreur se situe donc plus au niveau de Javascript que d'asp, va donc voir sur javascriptfr.com ...

pour voir si l'erreur vient bien de la fais tout simplement ca

onChange="javascript:location.href='PieceInformatique.asp?choix=3'">

Voila :)

Cyril
0
cs_artagnan Messages postés 20 Date d'inscription samedi 23 octobre 2004 Statut Membre Dernière intervention 15 mai 2011
24 nov. 2004 à 19:15
ok merci bin jai fais les changement
ce po suppose detre du asp jai essayer aussi la fonction javascript
on change

aussi que la valeur de mon recordset est une string non un id

je suis embete la
0
cs_artagnan Messages postés 20 Date d'inscription samedi 23 octobre 2004 Statut Membre Dernière intervention 15 mai 2011
24 nov. 2004 à 19:27
aussi jai limpressio que ma variable valeur ne vaut rien
aucune reponse dans response.writ(valeur)
0
jesusonline Messages postés 6814 Date d'inscription dimanche 15 décembre 2002 Statut Membre Dernière intervention 13 octobre 2010 29
24 nov. 2004 à 19:41
j'ai pas compris ce que t'as voulu me dire, tu peux me la refaire mais en francais :big)

Cyril
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
cs_artagnan Messages postés 20 Date d'inscription samedi 23 octobre 2004 Statut Membre Dernière intervention 15 mai 2011
24 nov. 2004 à 19:57
ce est le code corrige

mon probleme ma feuille saffiche avec le dropliste et quand je selectionne une categorie rien se passe ca refresh pas
ma valeur devrais etre = a mon request("choix")
jai limpression quelle ne vaut rien

<!--#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%>

----

<%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>
</tr>
<tr><td height="109">

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

Copyright@Microsecur
2004,
,
Webmaster
Steve Da Pratto


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

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

</html>
0
jesusonline Messages postés 6814 Date d'inscription dimanche 15 décembre 2002 Statut Membre Dernière intervention 13 octobre 2010 29
24 nov. 2004 à 20:05
en faisant ca, ca te dit quoi ?
<select id="cboCategorie" onChange="javascript:alert(document.PieceInformatique.cboCategorie.SelectedValue);" >

le mieux est d'aller voir sur javascriptfr.com car je ne connais pas assez javascript pour t'aider

Cyril
0
cboulas Messages postés 2641 Date d'inscription mercredi 2 juin 2004 Statut Membre Dernière intervention 8 janvier 2014 16
24 nov. 2004 à 20:28
Salut,

Bien déjà je sais pas si cela est important mais je ne mais pas de ';' dans un Select :

<s>infoP = "SELECT tblCategorie_Informatique.Categorie_Informatique FROM tblCategorie_Informatique;"</s>

infoP = "SELECT tblCategorie_Informatique.Categorie_Informatique FROM tblCategorie_Informatique"


Bien ensuite j'ai vu que ObjConn n'est pas déclarer avant cette ligne :

objrsAfficherCategorie.Open infoP, objConn, 2, 3, 1


Bien cela peux peut-être t'aider

Chris...
Web : Firstruner - eMail : [mailto:support@firstruner.com Support]
0
cs_artagnan Messages postés 20 Date d'inscription samedi 23 octobre 2004 Statut Membre Dernière intervention 15 mai 2011
24 nov. 2004 à 21:12
merci a vous autre de bien vouloir maider

pour ce qui est du point guillemet jelai toujour mits sa dois pas changer rien et il est declare plus haut

je crois que ca vient pluto au niveau de la valeur de la variable valeur elle devrais egale au choix pour ma requete dans acces

car la page naffichepo derreur sauf quelle ne reagi pas a levenement onclik

artagnan
0
Rejoignez-nous