fct OnChange du menu déroulant
Creation du formulaire et d'un menu déroulant :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
<? php creer_menu_deroulant(); ?>
<FORM id="modif" name="modif1" action="modifier.php" method="get" encType="text/plain">
<tr>
<td>
Nom
</td>
<td>
<input type="text" name="nom">
</td>
</tr>
<tr align="center">
<td colspan="2">
<input type="submit" value="Modifier">
</td>
</tr>
</form> |
Menu deroulant :
Code:
1 2 3 4 5 6 7 8 9 10
| <select size="1" name="D0" onchange="gen()">
<?php
while ($tab = mysql_fetch_row($result)
{
?>
<option value="" id="<?php =$tab["Id_util"]?>"><?php =$tab["nom"]." ".$tab["prenom"] ?></option>
<?php
}
?>
</select> |
Dans mon menu déroulant, j'ai l'évènement "OnChange="gen()", mais je ne sais pas codé cette fonction pour qu'elle remplisse les champs du formulaire (ci-dessus) en allant chercher les info dans une BD en utilisant l'idendifiant "id" de OPTION du menu déroulant.
Comment fait on cela ?
Merci d'avance