Remplir un formulaire en fonction dune liste
nita2006
Messages postés
79
Statut
Membre
-
miarana -
miarana -
Bonjour,
en fait j ai un formulaire avec une liste deroulante et un champ de texte "commentaire"
dont voici le code
<?php
mysql_connect("localhost", "root", "");
mysql_select_db("p2i");
$reponse = mysql_query("SELECT * FROM commandes_dsi"); // Requête SQL
while ($donnees = mysql_fetch_array($reponse) )
{
?>
<html>
<form method="POST">
<center>
<p><br>
<br>
<br>
</p>
<table width="200" border="1">
<tr>
<td><img src="banniere_dsi.jpg" width="800" height="160"></td>
</tr>
<tr>
<td height="500" bgcolor="#9EC2E4"> <center>
<p> </p>
<p><strong>Recherche par nom : </strong>
<?php
$sql = " SELECT distinct nom FROM commandes_dsi ";
$result = mysql_query($sql) or die("Requete pas comprise");?>
<select name="liste_nom" id="liste_nom">
<?php while ($row=mysql_fetch_array($result))
{
echo"<option>$row[0]</option>";
}?>
</select>
</p>
<table width="288" border="0">
<tr>
<td><strong>Nom </strong></td>
<td><input name="commenatire" type="text" id="date4" value="<?php echo $donnees['commenatire']; ?>" size="20" maxlength="35"></td>
</tr>
</table>
<p> </p>
<p> <br>
<br>
</p>
</center>
</form>
</html>
<?php
}
mysql_close(); // Déconnexion de MySQL
?>
et je oudrai que ce champ de texte soit rempli en fonction du choix du nom dans la liste deroulante j ai beau cherché sur le net je trouve bien qui peut m aider a avancer
en fait j ai un formulaire avec une liste deroulante et un champ de texte "commentaire"
dont voici le code
<?php
mysql_connect("localhost", "root", "");
mysql_select_db("p2i");
$reponse = mysql_query("SELECT * FROM commandes_dsi"); // Requête SQL
while ($donnees = mysql_fetch_array($reponse) )
{
?>
<html>
<form method="POST">
<center>
<p><br>
<br>
<br>
</p>
<table width="200" border="1">
<tr>
<td><img src="banniere_dsi.jpg" width="800" height="160"></td>
</tr>
<tr>
<td height="500" bgcolor="#9EC2E4"> <center>
<p> </p>
<p><strong>Recherche par nom : </strong>
<?php
$sql = " SELECT distinct nom FROM commandes_dsi ";
$result = mysql_query($sql) or die("Requete pas comprise");?>
<select name="liste_nom" id="liste_nom">
<?php while ($row=mysql_fetch_array($result))
{
echo"<option>$row[0]</option>";
}?>
</select>
</p>
<table width="288" border="0">
<tr>
<td><strong>Nom </strong></td>
<td><input name="commenatire" type="text" id="date4" value="<?php echo $donnees['commenatire']; ?>" size="20" maxlength="35"></td>
</tr>
</table>
<p> </p>
<p> <br>
<br>
</p>
</center>
</form>
</html>
<?php
}
mysql_close(); // Déconnexion de MySQL
?>
et je oudrai que ce champ de texte soit rempli en fonction du choix du nom dans la liste deroulante j ai beau cherché sur le net je trouve bien qui peut m aider a avancer
A voir également:
- Remplir un formulaire en fonction dune liste
- Whatsapp formulaire opposition - Guide
- Liste déroulante excel - Guide
- Fonction si et - Guide
- Formulaire de réclamation facebook compte désactivé - Guide
- Liste déroulante en cascade - Guide