begin process at 2012 05 27 18:13:02
  Trouver un code source :
 
dans
 
Accueil > Forum > 

Archive ASP & ASP.NET

 > 

Archives ASP & ASP.NET

 > 

VBScript

 > 

asp onchange


Derniers messages déposésPoser une question dans le forum ou lancer une discussion

asp onchange

mercredi 24 novembre 2004 à 18:13:09 | asp onchange

artagnan

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" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#0033FF">
<tr>
<td height="476">
<div align="center">
<table width="800" height="474" border="1" cellpadding="0" cellspacing="0">
<tr>
<td height="82">
<div align="center">
<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">
<param name="movie" value="logo.swf">
<param name=quality value=high><param name="LOOP" value="false">
<embed src="logo.swf" width="800" height="80" loop="false" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"></embed>
</object>
</div></td>
</tr>
<tr>
<td height="37" bgcolor="#333333">
<div align="center">

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

<td width="33"> <div align="right"> </div></td>
<td width="10"> <div align="center">
<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>
</div></td>
</tr>
</table>

</div></td>
</tr>
<tr>
<td height="109" bgcolor="#FF9900">
<div align="center">
<table width="798" height="102" border="0" cellpadding="0" cellspacing="0">
<tr>

<td height="102" bgcolor="#CCCCCC">
<%
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%>

<div align="center">
<tr>
<%Response.write "<td align='center' font='#ffcc00' bgcolor='#ffcc00'>" & objrsAfficherProduits("CodeUPC") & ""
Response.write "<td align='center' font='#ffcc00' bgcolor='#ffcc00'>" & objrsAfficherProduits("MarqueDeCommerce") & ""
Response.write "<td align='center' font='#ffcc00' bgcolor='#ffcc00'>" & objrsAfficherProduits("Model") & ""
Response.write "<td align='center' font='#ffcc00' bgcolor='#ffcc00'>" & objrsAfficherProduits("DetailArticle") & ""
Response.write "<td align='center' font='#ffcc00' bgcolor='#ffcc00'>" & objrsAfficherProduits("PrixClient") & ""
Response.write "<td align='center' font='#ffcc00' bgcolor='#ffcc00'>" & objrsAfficherProduits("QTEStock") & ""
objrsAfficherProduits.MoveNext

loop

response.Write("valeur")
%> </tr>
</div></td>
</tr>
</table>
mercredi 24 novembre 2004 à 18:54:00 | Re : asp onchange

jesusonline

Membre Club Administrateur CodeS-SourceS
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
mercredi 24 novembre 2004 à 19:15:45 | Re : asp onchange

artagnan

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
mercredi 24 novembre 2004 à 19:27:08 | Re : asp onchange

artagnan

aussi jai limpressio que ma variable valeur ne vaut rien
aucune reponse dans response.writ(valeur)
mercredi 24 novembre 2004 à 19:41:16 | Re : asp onchange

jesusonline

Membre Club Administrateur CodeS-SourceS
j'ai pas compris ce que t'as voulu me dire, tu peux me la refaire mais en francais


Cyril
mercredi 24 novembre 2004 à 19:57:58 | Re : asp onchange

artagnan

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"

%>
<body background="images/metal017.jpg">
<div align="center">
<form id="PieceInformatique" action="PieceInformatique.asp" method="post">
<table width="800" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#0033FF">
<tr>
<td height="476">
<div align="center">
<table width="800" height="474" border="1" cellpadding="0" cellspacing="0">
<tr>
<td height="82">
<div align="center">
<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">
<param name="movie" value="logo.swf">
<param name=quality value=high><param name="LOOP" value="false">
<embed src="logo.swf" width="800" height="80" loop="false" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash"></embed>
</object>
</div></td>
</tr>
<tr>
<td height="37" bgcolor="#333333">
<div align="center">

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

<td width="33"> <div align="right"> </div></td>
<td width="10"> <div align="center">
<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>
</div></td>
</tr>
</table>

</div></td>
</tr>
<tr>
<td height="109" bgcolor="#FF9900">
<div align="center">
<table width="798" height="102" border="0" cellpadding="0" cellspacing="0">
<tr>

<td height="102" bgcolor="#CCCCCC">
<%
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%>

<div align="center">
<tr>
<%Response.write "<td align='center' font='#ffcc00' bgcolor='#ffcc00'>" & objrsAfficherProduits("CodeUPC") & ""
Response.write "<td align='center' font='#ffcc00' bgcolor='#ffcc00'>" & objrsAfficherProduits("MarqueDeCommerce") & ""
Response.write "<td align='center' font='#ffcc00' bgcolor='#ffcc00'>" & objrsAfficherProduits("Model") & ""
Response.write "<td align='center' font='#ffcc00' bgcolor='#ffcc00'>" & objrsAfficherProduits("DetailArticle") & ""
Response.write "<td align='center' font='#ffcc00' bgcolor='#ffcc00'>" & objrsAfficherProduits("PrixClient") & ""
Response.write "<td align='center' font='#ffcc00' bgcolor='#ffcc00'>" & objrsAfficherProduits("QTEStock") & ""
objrsAfficherProduits.MoveNext

loop

response.Write("valeur")
%> </tr>
</div></td>
</tr>
</table>
</div></td>
</tr>
<tr><td height="109"><div align="center"><table width="798" height="122" border="0" cellpadding="0" cellspacing="0"><tr>
<td height="102" bgcolor="#FF9900">
<div align="center"></div></td>
</tr></table></div></td>
</tr>
<tr>
<td><div align="center">
<table width="75%" border="0" align="center">
<tr>
<td height="51"> <div align="center"><font color="#FFCC00">Copyright@Microsecur
2004</font></div></td>
<td><div align="center"><img src="images/terre_gr2.gif" width="52" height="49"></div></td>
<td><div align="center"><font color="#FFCC00">Webmaster
Steve Da Pratto</font></div></td>
</tr>
</table>
</div></td>
</tr>
</table>
</div></td>
</tr>
</table>
</form>
</div>
</body>
</html>
mercredi 24 novembre 2004 à 20:05:40 | Re : asp onchange

jesusonline

Membre Club Administrateur CodeS-SourceS
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
mercredi 24 novembre 2004 à 20:28:50 | Re : asp onchange

cboulas

Membre Club
Salut,

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


infoP = "SELECT tblCategorie_Informatique.Categorie_Informatique FROM tblCategorie_Informatique;"

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 : Support
mercredi 24 novembre 2004 à 21:12:17 | Re : asp onchange

artagnan

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


Cette discussion est classée dans : asp, write, response, onchange, objrsafficherproduits


Répondre à ce message

Sujets en rapport avec ce message

BESOIN AIDE SVP!!!! [ par anonyme ] Bonjour je suis débutant en ASP. J'apprends mais la je bloque et ça m'ennui pour poursuivre mon apprentissage. J'ai une station Win98. Dois je migrer Erreur lors de response.write () [ par MadM@tt ] Bonjour,voilà je précise que je viens de débuter ce soir l'asp lol donc je n'y connais rien (par contre je connais bien le VB)J'ai donc essayé un tuto ASp chartdirector [ par benjiconventi ] bonjour a l'équipe web et a tous les internautes, voila j'ai un petit souci en asp dut a mon niveau débutant.J'ai deux pages asp une qui ouvre ma base executer 2 actions sur formulaire [ par nickg ] Bonjour, j'ai un simple formulaire (form.asp) qui envoie, via une autre page "record.asp" les infos du formulaire dans une base de données. Une fois l Message d'erreur lors d'une mauvaise identification. [ par groovesalade ] Bonjour, je viens de terminer un site en ASP mais il subsiste une dernière petite erreur. Ce n'est pas important mais j'aimerai bien comprendre :J'ai asp.net : l'object application ne fonctionne pas? [ par Maroxye ] Bonjour!Je suis en asp.net. Mais j'ai trouvé un petit chat pour fournir du support aux usagers du site(livehelp) conçu en ASP et gratuit. Il fonctionn alors ca c'est fort !! [ par supersid ] Bonjour, Je vous explique mon problème, http://www.bigjack-cycle.com/animation.swfMon animation est sensé charger l'heure du ser Créer une fichier xml à l'aide d'ASP [ par hazrael ] Bonjour à tous,J'ai créé un fichier ASP, dans mon intranet pro, qui me permet de construire un fichier xml (data.asp). Lorsque je l'ouvre via un lien Lecture de flux XML [ par nrama ] Bonjour,Je souhaiterai vous soumetre un probléme que je rencontre et que je ne comprend absolument pasJ'execute une requete SQL avec un for XML qui me Serveur ASP [ par sidsad ] Bonjour,J'ai réalisé un site en localhost avec IIS 5 comme serveur sous windows 2000. Du code ASP 3.0 figure sur certaines pages (calculs sur des donn


Nos sponsors


Sondage...

CalendriCode

Mai 2012
LMMJVSD
 123456
78910111213
14151617181920
21222324252627
28293031   

Consulter la suite du CalendriCode

A découvrir



 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 1,279 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales