Page 1 sur 1

Problème Récuperation Nouvelle valeur d'un <input>

Posté : 28 mai 2009, 10:57
par consequences
Bonjour voila j'explique en fait mon problème est que j'affiche dans une boucle while tout
mes produits d'une commande (ref., Désignation, quantité et prix). Et je suis dans la partie
admin ou je voudrais pouvoir modifier la quantité. Mais le problème c'est dès que je clique
sur le bouton il me reprend sans cesse le valeur insérée dans la value par le biai de la base
de donnée et non la nouvelle quantité saisie.

Là le code de mon while :
//-------------------------------------------------------------- Affiche par le biai d'une boucle tant que de l'id produit, sa dresciption, la quantité, et son prix unitaire  -----------------------------------------------------------------------------//			
				$index.="\t\t\t\t<tr bgcolor=\"#a9b3c9\"><td width=\"13%\" align=\"center\"> Référence </td>\n";
				$index.="\t\t\t\t\t<td align=\"center\" align=\"center\"> Désignation </td>\n";
				$index.="\t\t\t\t\t<td width=\"11%\" align=\"center\"> Quantité </td>\n";
				$index.="\t\t\t\t\t<td width=\"11%\" align=\"center\"> Prix unitaire</td>\n";
				$index.="\t\t\t\t\t<td width=\"9%\" align=\"center\"> M. </td>\n";
				$index.="\t\t\t\t\t<td width=\"9%\" align=\"center\"> S. </td></tr>\n";
	while($rowCom=mysql_fetch_array($rsCom)){	
				$index.="\t\t\t\t<tr><td width=\"13%\" align=\"center\"><input type=\"text\" name=\"products_id\" value=\"".$rowCom['products_id']."\" size=\"7\" maxlength=\"11\" disabled/></td>\n";
				$index.="\t\t\t\t\t<td align=\"center\" align=\"center\"><input type=\"text\" name=\"products_description\"  value=\"".$rowCom['products_description']."\" size=\"64\" maxlength=\"150\" disabled/></td>\n";
				$index.="\t\t\t\t\t<td width=\"11%\" align=\"center\"><input type=\"text\" name=\"orders_products_quantity\"  value=\"".$rowCom['orders_products_quantity']."\" size=\"5\" maxlength=\"3\"/></td>\n";

				//----------------------------------------------------------------------------------- Remise sous forme monaitaire de total commande enregistré en base de donne -------------------------------------------------------------------------------------//
$prix_format_francais = number_format($rowCom['orders_products_price'], 2, ',', ' ');
				$index.="\t\t\t\t\t<td width=\"11%\"><input type=\"text\" name=\"orders_products_price\"  value=\"".$prix_format_francais."\" size=\"7\" maxlength=\"8\" disabled/></td>\n";
				$index.="\t\t\t\t\t<td align=\"center\"><a href=\"index.php?page=GererCommandeVDIArticleUpdate&orders_id=".$rowCom['orders_id']."&orders_products_id=".$rowCom['orders_products_id']."&products_id=".$rowCom['products_id']."\"><img src=\"images/principal.png\" border=\"0\" alt=\"Enregistrer la modification de quantité\"/></a></td>\n";
				$index.="\t\t\t\t\t<td align=\"center\"><a href=\"index.php?page=GererCommandeVDIArticleDelete&orders_id=".$rowCom['orders_id']."&orders_products_id=".$rowCom['orders_products_id']."\"><img src=\"images/supprimer.png\" border=\"0\" alt=\"Supprimer\"/></a></td></tr>\n";
	}	

Ensuite jessaye de recupérer de la manière suivante par un post :
//-------------------------------------------------------------------- Recuperation de l'id de la commande, id produit de commande , id produit et quandtité --------------------------------------------------------------------------------------------//
$orders_id=mysql_real_escape_string(htmlspecialchars($_REQUEST['orders_id']));
$orders_products_id=mysql_real_escape_string(htmlspecialchars($_REQUEST['orders_products_id']));
$products_id=mysql_real_escape_string(htmlspecialchars($_REQUEST['products_id']));
$orders_products_quantity=mysql_real_escape_string(htmlspecialchars($_POST['orders_products_quantity']));
Non bah c'est bon j'ai mis un form dans mon while ;)